SqlFunctions.PatIndex(String, String) Method

Definition

Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.

[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)

Parameters

stringPattern
String

A string pattern to search for.

target
String

The string to search.

Returns

The starting character position where the string pattern was found.

Attributes

Applies to