StringIndexOfAny Method (Char, Int32) |
Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public int IndexOfAny(
char[] anyOf,
int startIndex
)
Parameters
- anyOf
- Type: SystemChar
A Unicode character array containing one or more characters to seek. - startIndex
- Type: SystemInt32
The search starting position.
Return Value
Type:
Int32The zero-based index position of the first occurrence in this instance where any character in
anyOf was found; -1 if no character in
anyOf was found.
Exceptions Exception | Condition |
---|
ArgumentNullException | anyOf is null. |
ArgumentOutOfRangeException | startIndex is negative.-or- startIndex is greater than the number of characters in this instance. |
See Also