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.LastIndexOf (String, String, Int32, Int32, CompareOptions)

Gets the last index of the specified string within a string with specified starting and ending search indexes using flags.

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

Parameters

source
The string to search.
value
The string value 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
Last index The last index ofvalue in the string.
-1 The specified value is not found.
startIndex Thevalue argument is an empty string.

Exceptions

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

Remarks

The search starts from startIndex and ends at endIndex.

See Also

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