Share via


String.LastIndexOfAny Method (Char[])

Reports the index number, or character position, of the last occurrence in the current String object of any character within a specified array of Unicode characters.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

[MethodImplAttribute]
public int LastIndexOfAny (
         char[] anyOf
)

Parameters

  • anyOf
    An array of Unicode characters, any one or more of whose characters you want to find in the current String object.

Return Value

The character position of the last occurrence in the current String object of any character specified in the anyOf parameter, or -1 if no such character is found.

Remarks

The search begins at the last character position in the current String object and proceeds backward toward the beginning of the string until either a character specified in the anyOf parameter is found or the first character position has been examined (whichever occurs first).

Index numbering starts at 0 (zero).

The search for the anyOf parameter is both case-sensitive and culture-sensitive.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

String Class
String Members
System Namespace