System Namespace String Class
Reports the index position of the last occurrence in the given String 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.
[ VB ]
<Serializable>
Overloads Public Function LastIndexOfAny ( _
ByVal anyOf ( ) As Char, _
ByVal startIndex As Integer, _
ByVal count As Integer _
) As Integer
[ C# ]
[ Serializable ]
public int LastIndexOfAny (
char [ ] anyOf,
int startIndex,
int count
);
[ C++ ]
[ Serializable ]
public: int LastIndexOfAny (
__wchar_t anyOf __gc [ ],
int startIndex,
int count
);
[ JScript ]
public Serializable
function LastIndexOfAny (
anyOf : Char [ ],
startIndex : int,
count : int
) : int;
- anyOf
- A Unicode character array containing one or more characters to seek.
- startIndex
- The search starting position.
- count
- The number of character positions to examine.
The positive integer index of the last occurrence in the given String where any character in anyOf was found; otherwise, -1 if no character in anyOf was found.
This method begins searching at the startIndex character position of this instance and precedes backwards towards the beginning until either a character in anyOf is found or count character positions have been examined. The search is case-sensitive.
This method performs an ordinal ( culture-insensitive ) search, where a character is considered equivalent to another character only if the Unicode values are the same. To perform a culture-sensitive search, use the CompareInfo.IndexOf method, where a Unicode value representing a precomposed character, such as the ligature 'Æ' ( U+00C6 ), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" ( U+0041, U+0045 ), depending on the culture.
String Members String.LastIndexOfAny Overload List Char Int32 Array IndexOf IndexOfAny LastIndexOf