asp.net.ph

String.LastIndexOf Method ( String, Int32 )

System Namespace   String Class


Reports the index position of the last occurrence of a specified String within the given String. The search starts at a specified character position.

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

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

[ C++ ]
[ Serializable ]
public: int LastIndexOf (
   String* value,
   int startIndex
);

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

Parameters

value
The String to seek.
startIndex
The search starting position.

Return Value


Value Meaning
A positive index position. value was found.
startIndex value is Empty.
-1 value was not found.

Exceptions


Exception Type Condition
ArgumentNullException value is a null reference ( Nothing in Visual Basic ).
ArgumentOutOfRangeException startIndex is less than zero or specifies a position not within the given String.

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 the first character position has been examined. The search is case-sensitive.

See Also

String Members   String.LastIndexOf Overload List   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