asp.net.ph

String.IndexOf Method ( String, Int32, Int32 )

System Namespace   String Class


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

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

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

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

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

Parameters

value
The String to seek.
startIndex
The search starting position.
count
The number of character positions to examine.

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 count or startIndex is negative.

-or-

count plus startIndex specify a position not within the given String.


Remarks

The search begins at startIndex and continues to startIndex + count-1. The character at startIndex + count is not included in the search.

The search is case-sensitive and uses the current culture.

See Also

String Members   String.IndexOf Overload List   Int32   CultureInfo   IndexOfAny   LastIndexOf   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