Partager via


SqlServerDbFunctionsExtensions.PatIndex(DbFunctions, String, String) Method

Definition

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

public static long PatIndex (this Microsoft.EntityFrameworkCore.DbFunctions _, string pattern, string expression);
static member PatIndex : Microsoft.EntityFrameworkCore.DbFunctions * string * string -> int64
<Extension()>
Public Function PatIndex (_ As DbFunctions, pattern As String, expression As String) As Long

Parameters

_
DbFunctions

The DbFunctions instance.

pattern
String

A string pattern to search for.

expression
String

Typically a column that is searched for the specified pattern

Returns

Returns the starting position of the first occurrence of a pattern in a specified expression.

Remarks

See Database functions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.

Applies to