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.
[ VB ]
<Serializable>
Overloads Public Function IndexOf ( _
ByVal value As String, _
ByVal startIndex As Integer _
) As Integer
[ C# ]
[ Serializable ]
public int IndexOf (
string value,
int startIndex
);
[ C++ ]
[ Serializable ]
public: int IndexOf (
String* value,
int startIndex
);
[ JScript ]
public Serializable
function IndexOf (
value : String,
startIndex : int
) : int;
- value
- The String to seek.
- startIndex
- The search starting position.
Value |
Meaning |
A positive index position. |
value was found. |
startIndex |
value is Empty. |
-1 |
value was not found. |
The search begins at the startIndex character position of this instance and continues until the last character position. The search is case-sensitive and uses the current culture.
String Members String.IndexOf Overload List Int32 CultureInfo IndexOfAny LastIndexOf LastIndexOfAny