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

Returns the first index of the specified character within a string given the indexes for the search and flags.

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

Parameters

source
The string to search.
value
The character to search for within the string.
startIndex
The starting index of the search.
endIndex
The ending index of the search. The search will continue to the end of the string when endIndex is-1.
options
The specified flags are the following data members: IgnoreCase, IgnoreKanaType, IgnoreNonSpace, IgnoreSymbols, IgnoreWidth, and StringSort.

Return Value

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

Exceptions

Exception Type Condition
ArgumentException The value argument is null[RB18] .
IndexOutOfRangeException The startIndex or endIndex arguments are [RB19] less than 0 or greater than the length of string.

See Also

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