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)

适用于