StringLastIndexOfAny Method (Char, Int32, Int32) |
Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. The search starts at a specified character position and examines a specified number of character positions.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public int LastIndexOfAny(
char[] anyOf,
int startIndex,
int count
)
Parameters
- anyOf
- Type: SystemChar
A Unicode character array containing one or more characters to seek. - startIndex
- Type: SystemInt32
The search starting position. The search proceeds from startIndex toward the beginning of this instance. - count
- Type: SystemInt32
The number of character positions to examine.
Return Value
Type:
Int32The index position of the last occurrence in this instance where any character in
anyOf was found; -1 if no character in
anyOf was found or if the current instance equals
Empty.
Exceptions Exception | Condition |
---|
ArgumentNullException | anyOf is null. |
ArgumentOutOfRangeException | The current instance does not equal Empty, and count or startIndex is negative.-or- The current instance does not equal Empty and startIndex minus count specifies a position that is not within this instance. |
See Also