asp.net.ph

String.LastIndexOf Method ( Char, Int32, Int32 )

System Namespace   String Class


Reports the index position of the last occurrence of a given Unicode character in a substring within the given String. The search starts at a specified character position and examines a specified number of character positions.

[ VB ]
<Serializable>
Overloads Public Function LastIndexOf ( _
   ByVal value As Char, _
   ByVal startIndex As Integer, _
   ByVal count As Integer _
) As Integer

[ C# ]
[ Serializable ]
public int LastIndexOf (
   char value,
   int startIndex,
   int count
);

[ C++ ]
[ Serializable ]
public: int LastIndexOf (
   __wchar_t value,
   int startIndex,
   int count
);

[ JScript ]
public Serializable
function LastIndexOf (
   value : Char,
   startIndex : int,
   count : int
) : int;

Parameters

value
A Unicode character to seek.
startIndex
The starting position of a substring within the given String.
count
The number of character positions to examine.

Return Value

The index position of value if that character is found, or -1 if it is not.

Exceptions


Exception Type Condition
ArgumentNullException value is a null reference ( Nothing in Visual Basic ).
ArgumentOutOfRangeException startIndex or count is less than zero or greater than the length of this instance.

Remarks

This method begins searching at the startIndex character position of this instance and precedes backwards towards the beginning until either value is found or count character positions have been examined. The search is case-sensitive.

See Also

String Members   String.LastIndexOf Overload List   Char   Int32   IndexOf   IndexOfAny   LastIndexOfAny Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph