SqlFunctions.PatIndex(String, String) 方法

定义

返回指定表达式中模式的第一个匹配项的起始位置;如果未找到模式,则返回所有有效文本和字符数据类型上的零。

public:
 static Nullable<int> PatIndex(System::String ^ stringPattern, System::String ^ target);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "PATINDEX")]
public static int? PatIndex(string stringPattern, string target);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "PATINDEX")>]
static member PatIndex : string * string -> Nullable<int>
Public Shared Function PatIndex (stringPattern As String, target As String) As Nullable(Of Integer)

参数

stringPattern
String

要搜索的字符串模式。

target
String

要搜索的字符串。

返回

找到字符串模式的起始字符位置。

属性

注解

不能直接调用此函数。 此函数只能在 LINQ to Entities 查询中显示。

此函数将转换为数据库中的相应函数。 有关相应SQL Server函数的信息,请参阅 PATINDEX (Transact-SQL)

适用于