SqlFunctions.PatIndex(String, String) SqlFunctions.PatIndex(String, String) SqlFunctions.PatIndex(String, String) 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.

public:
 static Nullable<int> PatIndex(System::String ^ stringPattern, System::String ^ target);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "PATINDEX")]
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 String String String

A string pattern to search for.

target
String String String String

The string to search.

Returns

The starting character position where the string pattern was found.

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database. For information about the corresponding SQL Server function, see PATINDEX (Transact-SQL).

Applies to