NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

String.IndexOf (String)

Determines the position within this string of the first occurrence of the specified string.

[Visual Basic]
Overloads Public Function IndexOf( _
   ByVal value As String _
) As Integer
[C#]
public int IndexOf(
   string value
);
[C++]
public: int IndexOf(
   String* value
);
[JScript]
public function IndexOf(
   value : String
) : int;

Parameters

value
The string to search for.

Return Value

Value Condition
The position If the string is found.
The position search began If the string is the empty string.
-1 If the string is not found.

Exceptions

Exception Type Condition
ArgumentNullException If the string is null.

Remarks

The IndexOf method searches for a specified string and returns the index. The search begins at the first character of this string. The search is case-sensitive, CultureInfo sensitive, and the default locale is used. This method returns the CurrentCulture information.

The value parameter returns the position from where search commenced if value is the empty string (see Empty).

See Also

String Class | String Members | System Namespace | String.IndexOf Overload List | Int32