SqlFunctions.PatIndex(String, String) 方法

定义

返回模式在指定表达式中第一次出现的起始位置;如果在所有有效的文本和字符数据类型中都找不到该模式,则返回零。

[System.Data.Entity.DbFunction("SqlServer", "PATINDEX")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="stringPattern")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId="string")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="target")]
public static Nullable<int> PatIndex (string stringPattern, string target);
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

要搜索的字符串。

返回

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

属性

适用于