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, Int32)

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

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

Parameters

value
The string to search for.
startIndex
The position to begin the search.

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.
ArgumentOutOfRangeException If the start position is not a valid position in this string.

Remarks

The IndexOf method searches for a specified string from the specified starting position and returns the index. The search begins at the first character of this string; it 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