SqlFunctions.CharIndex Method

Definition

Returns the starting position of one expression found within another expression.

Overloads

CharIndex(String, String, Nullable<Int64>)

Returns the starting position of one expression found within another expression.

CharIndex(Byte[], Byte[], Nullable<Int64>)

Returns the starting position of one expression found within another expression.

CharIndex(String, String, Nullable<Int32>)

Returns the starting position of one expression found within another expression.

CharIndex(String, String)

Returns the starting position of one expression found within another expression.

CharIndex(Byte[], Byte[])

Returns the starting position of one expression found within another expression.

CharIndex(Byte[], Byte[], Nullable<Int32>)

Returns the starting position of one expression found within another expression.

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 CHARINDEX (Transact-SQL).

CharIndex(String, String, Nullable<Int64>)

Returns the starting position of one expression found within another expression.

public:
 static Nullable<long> CharIndex(System::String ^ toSearch, System::String ^ target, Nullable<long> startLocation);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")]
public static long? CharIndex (string toSearch, string target, long? startLocation);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")>]
static member CharIndex : string * string * Nullable<int64> -> Nullable<int64>
Public Shared Function CharIndex (toSearch As String, target As String, startLocation As Nullable(Of Long)) As Nullable(Of Long)

Parameters

toSearch
String

The string expression to be searched.

target
String

The string expression to be found.

startLocation
Nullable<Int64>

The character position in toSearch where searching begins.

Returns

A Nullable<T> of Int64 value that is the starting position of target if it is found in toSearch.

Attributes

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 CHARINDEX (Transact-SQL).

Applies to

CharIndex(Byte[], Byte[], Nullable<Int64>)

Returns the starting position of one expression found within another expression.

public:
 static Nullable<long> CharIndex(cli::array <System::Byte> ^ toSearch, cli::array <System::Byte> ^ target, Nullable<long> startLocation);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")]
public static long? CharIndex (byte[] toSearch, byte[] target, long? startLocation);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")>]
static member CharIndex : byte[] * byte[] * Nullable<int64> -> Nullable<int64>
Public Shared Function CharIndex (toSearch As Byte(), target As Byte(), startLocation As Nullable(Of Long)) As Nullable(Of Long)

Parameters

toSearch
Byte[]

The string expression to be searched.

target
Byte[]

The string expression to be found.

startLocation
Nullable<Int64>

The character position in toSearch at which searching begins.

Returns

The starting position of target if it is found in toSearch.

Attributes

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 CHARINDEX (Transact-SQL).

Applies to

CharIndex(String, String, Nullable<Int32>)

Returns the starting position of one expression found within another expression.

public:
 static Nullable<int> CharIndex(System::String ^ toSearch, System::String ^ target, Nullable<int> startLocation);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")]
public static int? CharIndex (string toSearch, string target, int? startLocation);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")>]
static member CharIndex : string * string * Nullable<int> -> Nullable<int>
Public Shared Function CharIndex (toSearch As String, target As String, startLocation As Nullable(Of Integer)) As Nullable(Of Integer)

Parameters

toSearch
String

The string expression to be searched.

target
String

The string expression to be found.

startLocation
Nullable<Int32>

The character position in toSearch where searching begins.

Returns

The starting position of target if it is found in toSearch.

Attributes

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 CHARINDEX (Transact-SQL).

Applies to

CharIndex(String, String)

Returns the starting position of one expression found within another expression.

public:
 static Nullable<int> CharIndex(System::String ^ toSearch, System::String ^ target);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")]
public static int? CharIndex (string toSearch, string target);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")>]
static member CharIndex : string * string -> Nullable<int>
Public Shared Function CharIndex (toSearch As String, target As String) As Nullable(Of Integer)

Parameters

toSearch
String

The string expression to be searched.

target
String

The string expression to be found.

Returns

The starting position of target if it is found in toSearch.

Attributes

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 CHARINDEX (Transact-SQL).

Applies to

CharIndex(Byte[], Byte[])

Returns the starting position of one expression found within another expression.

public:
 static Nullable<int> CharIndex(cli::array <System::Byte> ^ toSearch, cli::array <System::Byte> ^ target);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")]
public static int? CharIndex (byte[] toSearch, byte[] target);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")>]
static member CharIndex : byte[] * byte[] -> Nullable<int>
Public Shared Function CharIndex (toSearch As Byte(), target As Byte()) As Nullable(Of Integer)

Parameters

toSearch
Byte[]

The string expression to be searched.

target
Byte[]

The string expression to be found.

Returns

The starting position of target if it is found in toSearch.

Attributes

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 CHARINDEX (Transact-SQL).

Applies to

CharIndex(Byte[], Byte[], Nullable<Int32>)

Returns the starting position of one expression found within another expression.

public:
 static Nullable<int> CharIndex(cli::array <System::Byte> ^ toSearch, cli::array <System::Byte> ^ target, Nullable<int> startLocation);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")]
public static int? CharIndex (byte[] toSearch, byte[] target, int? startLocation);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "CHARINDEX")>]
static member CharIndex : byte[] * byte[] * Nullable<int> -> Nullable<int>
Public Shared Function CharIndex (toSearch As Byte(), target As Byte(), startLocation As Nullable(Of Integer)) As Nullable(Of Integer)

Parameters

toSearch
Byte[]

The string expression to be searched.

target
Byte[]

The string expression to be found.

startLocation
Nullable<Int32>

The character position in toSearch where searching begins.

Returns

The starting position of target if it is found in toSearch.

Attributes

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 CHARINDEX (Transact-SQL).

Applies to