Returns the first index of the specified string within a string.
[Visual Basic] Overloads Overridable Public Function IndexOf( _ ByVal source As String, _ ByVal value As String _ ) As Integer [C#] public virtual int IndexOf( string source, string value ); [C++] public: virtual int IndexOf( String* source, String* value ); [JScript] public function IndexOf( source : String, value : String ) : int;
Value | Meaning |
---|---|
Less than 0 | The first index where the specified stringvalue is found. |
-1 | The specified value is not found. |
0 | Thevalue argument is an empty string. |
Exception Type | Condition |
---|---|
ArgumentException | is thrown if the value argument is null. |
The entire string is searched.
CompareInfo Class | CompareInfo Members | System.Globalization Namespace | CompareInfo.IndexOf Overload List