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!

CompareInfo.IndexOf (String, Char)

Returns the first index of the specified character within a string.

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

Parameters

source
The string to search.
value
The character value to search for in the string.

Return Value

Value Meaning
Less than 0 The first index where the specified stringvalue is found.
-1 The specified value is not found.
0 Thevalue parameter is an empty string.

Exceptions

Exception Type Condition
ArgumentException is thrown if the value argument is null[RB16] .

Remarks

The entire string is searched.

See Also

CompareInfo Class | CompareInfo Members | System.Globalization Namespace | CompareInfo.IndexOf Overload List