語言

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

要搜尋的字串。

傳回

起始字元位置,也就是找到弦圖案的地方。

屬性

適用於