Прочетете на английски Редактиране

Споделяне чрез


EdmFunctions.IndexOf(DbExpression, DbExpression) Method

Definition

Creates a DbFunctionExpression that invokes the canonical 'IndexOf' function with the specified arguments, which must each have a string result type. The result type of the expression is Edm.Int32.

C#
public static System.Data.Common.CommandTrees.DbFunctionExpression IndexOf(this System.Data.Common.CommandTrees.DbExpression searchString, System.Data.Common.CommandTrees.DbExpression stringToFind);

Parameters

searchString
DbExpression

An expression that specifies the string to search for stringToFind.

stringToFind
DbExpression

An expression that specifies the string to locate within searchString should be checked.

Returns

A new DbFunctionExpression that returns the first index of stringToFind in searchString.

Exceptions

searchString or stringToFind is null.

searchString or stringToFind is invalid.

Remarks

The index returned by IndexOf is <b>1-based</b>.

Applies to

Продукт Версии
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1