SqlFunctions.CharIndex 方法

定义

返回在一个表达式中找到的另一个表达式的起始位置。

重载

CharIndex(String, String, Nullable<Int64>)

返回在一个表达式中找到的另一个表达式的起始位置。

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

返回在一个表达式中找到的另一个表达式的起始位置。

CharIndex(String, String, Nullable<Int32>)

返回在一个表达式中找到的另一个表达式的起始位置。

CharIndex(String, String)

返回在一个表达式中找到的另一个表达式的起始位置。

CharIndex(Byte[], Byte[])

返回在一个表达式中找到的另一个表达式的起始位置。

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

返回在一个表达式中找到的另一个表达式的起始位置。

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 CHARINDEX (Transact-SQL)

CharIndex(String, String, Nullable<Int64>)

返回在一个表达式中找到的另一个表达式的起始位置。

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)

参数

toSearch
String

要搜索的字符串表达式。

target
String

要查找的字符串表达式。

startLocation
Nullable<Int64>

toSearch 中搜索开始处的字符位置。

返回

如果在 target 中找到 toSearch,则为表示其起始位置的 Nullable<T> 值的 Int64

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 CHARINDEX (Transact-SQL)

适用于

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

返回在一个表达式中找到的另一个表达式的起始位置。

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)

参数

toSearch
Byte[]

要搜索的字符串表达式。

target
Byte[]

要查找的字符串表达式。

startLocation
Nullable<Int64>

toSearch 中搜索开始处的字符位置。

返回

如果在 target 中找到 toSearch,则为其起始位置。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 CHARINDEX (Transact-SQL)

适用于

CharIndex(String, String, Nullable<Int32>)

返回在一个表达式中找到的另一个表达式的起始位置。

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)

参数

toSearch
String

要搜索的字符串表达式。

target
String

要查找的字符串表达式。

startLocation
Nullable<Int32>

toSearch 中搜索开始处的字符位置。

返回

如果在 target 中找到 toSearch,则为其起始位置。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 CHARINDEX (Transact-SQL)

适用于

CharIndex(String, String)

返回在一个表达式中找到的另一个表达式的起始位置。

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)

参数

toSearch
String

要搜索的字符串表达式。

target
String

要查找的字符串表达式。

返回

如果在 target 中找到 toSearch,则为其起始位置。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 CHARINDEX (Transact-SQL)

适用于

CharIndex(Byte[], Byte[])

返回在一个表达式中找到的另一个表达式的起始位置。

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)

参数

toSearch
Byte[]

要搜索的字符串表达式。

target
Byte[]

要查找的字符串表达式。

返回

如果在 target 中找到 toSearch,则为其起始位置。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 CHARINDEX (Transact-SQL)

适用于

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

返回在一个表达式中找到的另一个表达式的起始位置。

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)

参数

toSearch
Byte[]

要搜索的字符串表达式。

target
Byte[]

要查找的字符串表达式。

startLocation
Nullable<Int32>

toSearch 中搜索开始处的字符位置。

返回

如果在 target 中找到 toSearch,则为其起始位置。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 CHARINDEX (Transact-SQL)

适用于