mscorlib(4.0.0.0) API with additions
System.Globalization.CompareInfo Class Reference

Implements a set of methods for culture-sensitive string comparisons. More...

Inheritance diagram for System.Globalization.CompareInfo:
[legend]
Collaboration diagram for System.Globalization.CompareInfo:
[legend]

Public Member Functions

virtual int Compare (string string1, string string2)
 Compares two strings. More...
 
virtual int Compare (string string1, string string2, CompareOptions options)
 Compares two strings using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int Compare (string string1, int offset1, int length1, string string2, int offset2, int length2)
 Compares a section of one string with a section of another string. More...
 
virtual int Compare (string string1, int offset1, string string2, int offset2, CompareOptions options)
 Compares the end section of a string with the end section of another string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int Compare (string string1, int offset1, string string2, int offset2)
 Compares the end section of a string with the end section of another string. More...
 
virtual int Compare (string string1, int offset1, int length1, string string2, int offset2, int length2, CompareOptions options)
 Compares a section of one string with a section of another string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual bool IsPrefix (string source, string prefix, CompareOptions options)
 Determines whether the specified source string starts with the specified prefix using the specified T:System.Globalization.CompareOptions value. More...
 
virtual bool IsPrefix (string source, string prefix)
 Determines whether the specified source string starts with the specified prefix. More...
 
virtual bool IsSuffix (string source, string suffix, CompareOptions options)
 Determines whether the specified source string ends with the specified suffix using the specified T:System.Globalization.CompareOptions value. More...
 
virtual bool IsSuffix (string source, string suffix)
 Determines whether the specified source string ends with the specified suffix. More...
 
virtual int IndexOf (string source, char value)
 Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string. More...
 
virtual int IndexOf (string source, string value)
 Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string. More...
 
virtual int IndexOf (string source, char value, CompareOptions options)
 Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int IndexOf (string source, string value, CompareOptions options)
 Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int IndexOf (string source, char value, int startIndex)
 Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string. More...
 
virtual int IndexOf (string source, string value, int startIndex)
 Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string. More...
 
virtual int IndexOf (string source, char value, int startIndex, CompareOptions options)
 Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int IndexOf (string source, string value, int startIndex, CompareOptions options)
 Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int IndexOf (string source, char value, int startIndex, int count)
 Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements. More...
 
virtual int IndexOf (string source, string value, int startIndex, int count)
 Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements. More...
 
virtual int IndexOf (string source, char value, int startIndex, int count, CompareOptions options)
 Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int IndexOf (string source, string value, int startIndex, int count, CompareOptions options)
 Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int LastIndexOf (string source, char value)
 Searches for the specified character and returns the zero-based index of the last occurrence within the entire source string. More...
 
virtual int LastIndexOf (string source, string value)
 Searches for the specified substring and returns the zero-based index of the last occurrence within the entire source string. More...
 
virtual int LastIndexOf (string source, char value, CompareOptions options)
 Searches for the specified character and returns the zero-based index of the last occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int LastIndexOf (string source, string value, CompareOptions options)
 Searches for the specified substring and returns the zero-based index of the last occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int LastIndexOf (string source, char value, int startIndex)
 Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index. More...
 
virtual int LastIndexOf (string source, string value, int startIndex)
 Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index. More...
 
virtual int LastIndexOf (string source, char value, int startIndex, CompareOptions options)
 Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int LastIndexOf (string source, string value, int startIndex, CompareOptions options)
 Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int LastIndexOf (string source, char value, int startIndex, int count)
 Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index. More...
 
virtual int LastIndexOf (string source, string value, int startIndex, int count)
 Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index. More...
 
virtual int LastIndexOf (string source, char value, int startIndex, int count, CompareOptions options)
 Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index using the specified T:System.Globalization.CompareOptions value. More...
 
virtual int LastIndexOf (string source, string value, int startIndex, int count, CompareOptions options)
 Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index using the specified T:System.Globalization.CompareOptions value. More...
 
virtual SortKey GetSortKey (string source, CompareOptions options)
 Gets a T:System.Globalization.SortKey object for the specified string using the specified T:System.Globalization.CompareOptions value. More...
 
virtual SortKey GetSortKey (string source)
 Gets the sort key for the specified string. More...
 
override bool Equals (object value)
 Determines whether the specified object is equal to the current T:System.Globalization.CompareInfo object. More...
 
override int GetHashCode ()
 Serves as a hash function for the current T:System.Globalization.CompareInfo for hashing algorithms and data structures, such as a hash table. More...
 
virtual int GetHashCode (string source, CompareOptions options)
 Gets the hash code for a string based on specified comparison options. More...
 
override string ToString ()
 Returns a string that represents the current T:System.Globalization.CompareInfo object. More...
 

Static Public Member Functions

static CompareInfo GetCompareInfo (int culture, Assembly assembly)
 Initializes a new T:System.Globalization.CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified T:System.Reflection.Assembly. More...
 
static CompareInfo GetCompareInfo (string name, Assembly assembly)
 Initializes a new T:System.Globalization.CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified T:System.Reflection.Assembly. More...
 
static CompareInfo GetCompareInfo (int culture)
 Initializes a new T:System.Globalization.CompareInfo object that is associated with the culture with the specified identifier. More...
 
static CompareInfo GetCompareInfo (string name)
 Initializes a new T:System.Globalization.CompareInfo object that is associated with the culture with the specified name. More...
 
static bool IsSortable (char ch)
 Indicates whether a specified Unicode character is sortable. More...
 
static bool IsSortable (string text)
 Indicates whether a specified Unicode string is sortable. More...
 

Public Attributes

int LCID => CultureInfo.GetCultureInfo(Name).LCID
 Gets the properly formed culture identifier for the current T:System.Globalization.CompareInfo. More...
 

Properties

virtual string Name [get]
 Gets the name of the culture used for sorting operations by this T:System.Globalization.CompareInfo object. More...
 
SortVersionVersion [get]
 Gets information about the version of Unicode used for comparing and sorting strings. More...
 

Detailed Description

Implements a set of methods for culture-sensitive string comparisons.

Definition at line 13 of file CompareInfo.cs.

Member Function Documentation

◆ Compare() [1/6]

virtual int System.Globalization.CompareInfo.Compare ( string  string1,
string  string2 
)
virtual

Compares two strings.

Parameters
string1The first string to compare.
string2The second string to compare.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.Value Condition zero The two strings are equal. less than zero string1 is less than string2 . greater than zero string1 is greater than string2 .

Definition at line 313 of file CompareInfo.cs.

◆ Compare() [2/6]

virtual int System.Globalization.CompareInfo.Compare ( string  string1,
string  string2,
CompareOptions  options 
)
virtual

Compares two strings using the specified T:System.Globalization.CompareOptions value.

Parameters
string1The first string to compare.
string2The second string to compare.
optionsA value that defines how string1 and string2 should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, F:System.Globalization.CompareOptions.IgnoreKanaType, and F:System.Globalization.CompareOptions.StringSort.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.Value Condition zero The two strings are equal. less than zero string1 is less than string2 . greater than zero string1 is greater than string2 .
Exceptions
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 329 of file CompareInfo.cs.

◆ Compare() [3/6]

virtual int System.Globalization.CompareInfo.Compare ( string  string1,
int  offset1,
int  length1,
string  string2,
int  offset2,
int  length2 
)
virtual

Compares a section of one string with a section of another string.

Parameters
string1The first string to compare.
offset1The zero-based index of the character in string1 at which to start comparing.
length1The number of consecutive characters in string1 to compare.
string2The second string to compare.
offset2The zero-based index of the character in string2 at which to start comparing.
length2The number of consecutive characters in string2 to compare.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.Value Condition zero The two strings are equal. less than zero The specified section of string1 is less than the specified section of string2 . greater than zero The specified section of string1 is greater than the specified section of string2 .
Exceptions
T:System.ArgumentOutOfRangeExceptionoffset1 or length1 or offset2 or length2 is less than zero.-or- offset1 is greater than or equal to the number of characters in string1 .-or- offset2 is greater than or equal to the number of characters in string2 .-or- length1 is greater than the number of characters from offset1 to the end of string1 .-or- length2 is greater than the number of characters from offset2 to the end of string2 .

Definition at line 377 of file CompareInfo.cs.

◆ Compare() [4/6]

virtual int System.Globalization.CompareInfo.Compare ( string  string1,
int  offset1,
string  string2,
int  offset2,
CompareOptions  options 
)
virtual

Compares the end section of a string with the end section of another string using the specified T:System.Globalization.CompareOptions value.

Parameters
string1The first string to compare.
offset1The zero-based index of the character in string1 at which to start comparing.
string2The second string to compare.
offset2The zero-based index of the character in string2 at which to start comparing.
optionsA value that defines how string1 and string2 should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, F:System.Globalization.CompareOptions.IgnoreKanaType, and F:System.Globalization.CompareOptions.StringSort.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.Value Condition zero The two strings are equal. less than zero The specified section of string1 is less than the specified section of string2 . greater than zero The specified section of string1 is greater than the specified section of string2 .
Exceptions
T:System.ArgumentOutOfRangeExceptionoffset1 or offset2 is less than zero.-or- offset1 is greater than or equal to the number of characters in string1 .-or- offset2 is greater than or equal to the number of characters in string2 .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 396 of file CompareInfo.cs.

◆ Compare() [5/6]

virtual int System.Globalization.CompareInfo.Compare ( string  string1,
int  offset1,
string  string2,
int  offset2 
)
virtual

Compares the end section of a string with the end section of another string.

Parameters
string1The first string to compare.
offset1The zero-based index of the character in string1 at which to start comparing.
string2The second string to compare.
offset2The zero-based index of the character in string2 at which to start comparing.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.Value Condition zero The two strings are equal. less than zero The specified section of string1 is less than the specified section of string2 . greater than zero The specified section of string1 is greater than the specified section of string2 .
Exceptions
T:System.ArgumentOutOfRangeExceptionoffset1 or offset2 is less than zero.-or- offset1 is greater than or equal to the number of characters in string1 .-or- offset2 is greater than or equal to the number of characters in string2 .

Definition at line 412 of file CompareInfo.cs.

◆ Compare() [6/6]

virtual int System.Globalization.CompareInfo.Compare ( string  string1,
int  offset1,
int  length1,
string  string2,
int  offset2,
int  length2,
CompareOptions  options 
)
virtual

Compares a section of one string with a section of another string using the specified T:System.Globalization.CompareOptions value.

Parameters
string1The first string to compare.
offset1The zero-based index of the character in string1 at which to start comparing.
length1The number of consecutive characters in string1 to compare.
string2The second string to compare.
offset2The zero-based index of the character in string2 at which to start comparing.
length2The number of consecutive characters in string2 to compare.
optionsA value that defines how string1 and string2 should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, F:System.Globalization.CompareOptions.IgnoreKanaType, and F:System.Globalization.CompareOptions.StringSort.
Returns
A 32-bit signed integer indicating the lexical relationship between the two comparands.Value Condition zero The two strings are equal. less than zero The specified section of string1 is less than the specified section of string2 . greater than zero The specified section of string1 is greater than the specified section of string2 .
Exceptions
T:System.ArgumentOutOfRangeExceptionoffset1 or length1 or offset2 or length2 is less than zero.-or- offset1 is greater than or equal to the number of characters in string1 .-or- offset2 is greater than or equal to the number of characters in string2 .-or- length1 is greater than the number of characters from offset1 to the end of string1 .-or- length2 is greater than the number of characters from offset2 to the end of string2 .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 436 of file CompareInfo.cs.

◆ Equals()

override bool System.Globalization.CompareInfo.Equals ( object  value)

Determines whether the specified object is equal to the current T:System.Globalization.CompareInfo object.

Parameters
valueThe object to compare with the current T:System.Globalization.CompareInfo.
Returns
true if the specified object is equal to the current T:System.Globalization.CompareInfo; otherwise, false.

Definition at line 1263 of file CompareInfo.cs.

◆ GetCompareInfo() [1/4]

static CompareInfo System.Globalization.CompareInfo.GetCompareInfo ( int  culture,
Assembly  assembly 
)
static

Initializes a new T:System.Globalization.CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified T:System.Reflection.Assembly.

Parameters
cultureAn integer representing the culture identifier.
assemblyAn T:System.Reflection.Assembly that contains the string comparison methods to use.
Returns
A new T:System.Globalization.CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current T:System.Reflection.Assembly.
Exceptions
T:System.ArgumentNullExceptionassembly is null.
T:System.ArgumentExceptionassembly is of an invalid type.

Definition at line 133 of file CompareInfo.cs.

◆ GetCompareInfo() [2/4]

static CompareInfo System.Globalization.CompareInfo.GetCompareInfo ( string  name,
Assembly  assembly 
)
static

Initializes a new T:System.Globalization.CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified T:System.Reflection.Assembly.

Parameters
nameA string representing the culture name.
assemblyAn T:System.Reflection.Assembly that contains the string comparison methods to use.
Returns
A new T:System.Globalization.CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current T:System.Reflection.Assembly.
Exceptions
T:System.ArgumentNullExceptionname is null.-or- assembly is null.
T:System.ArgumentExceptionname is an invalid culture name.-or- assembly is of an invalid type.

Definition at line 156 of file CompareInfo.cs.

◆ GetCompareInfo() [3/4]

static CompareInfo System.Globalization.CompareInfo.GetCompareInfo ( int  culture)
static

Initializes a new T:System.Globalization.CompareInfo object that is associated with the culture with the specified identifier.

Parameters
cultureAn integer representing the culture identifier.
Returns
A new T:System.Globalization.CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current T:System.Reflection.Assembly.

Definition at line 172 of file CompareInfo.cs.

◆ GetCompareInfo() [4/4]

static CompareInfo System.Globalization.CompareInfo.GetCompareInfo ( string  name)
static

Initializes a new T:System.Globalization.CompareInfo object that is associated with the culture with the specified name.

Parameters
nameA string representing the culture name.
Returns
A new T:System.Globalization.CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current T:System.Reflection.Assembly.
Exceptions
T:System.ArgumentNullExceptionname is null.
T:System.ArgumentExceptionname is an invalid culture name.

Definition at line 189 of file CompareInfo.cs.

◆ GetHashCode() [1/2]

override int System.Globalization.CompareInfo.GetHashCode ( )

Serves as a hash function for the current T:System.Globalization.CompareInfo for hashing algorithms and data structures, such as a hash table.

Returns
A hash code for the current T:System.Globalization.CompareInfo.

Definition at line 1276 of file CompareInfo.cs.

◆ GetHashCode() [2/2]

virtual int System.Globalization.CompareInfo.GetHashCode ( string  source,
CompareOptions  options 
)
virtual

Gets the hash code for a string based on specified comparison options.

Parameters
sourceThe string whose hash code is to be returned.
optionsA value that determines how strings are compared.
Returns
A 32-bit signed integer hash code.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1288 of file CompareInfo.cs.

◆ GetSortKey() [1/2]

virtual SortKey System.Globalization.CompareInfo.GetSortKey ( string  source,
CompareOptions  options 
)
virtual

Gets a T:System.Globalization.SortKey object for the specified string using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string for which a T:System.Globalization.SortKey object is obtained.
optionsA bitwise combination of one or more of the following enumeration values that define how the sort key is calculated: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, F:System.Globalization.CompareOptions.IgnoreKanaType, and F:System.Globalization.CompareOptions.StringSort.
Returns
The T:System.Globalization.SortKey object that contains the sort key for the specified string.
Exceptions
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 1210 of file CompareInfo.cs.

◆ GetSortKey() [2/2]

virtual SortKey System.Globalization.CompareInfo.GetSortKey ( string  source)
virtual

Gets the sort key for the specified string.

Parameters
sourceThe string for which a T:System.Globalization.SortKey object is obtained.
Returns
The T:System.Globalization.SortKey object that contains the sort key for the specified string.

Definition at line 1218 of file CompareInfo.cs.

◆ IndexOf() [1/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
char  value 
)
virtual

Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string.

Parameters
sourceThe string to search.
valueThe character to locate within source .
Returns
The zero-based index of the first occurrence of value , if found, within source ; otherwise, -1. Returns 0 (zero) if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 623 of file CompareInfo.cs.

◆ IndexOf() [2/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
string  value 
)
virtual

Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string.

Parameters
sourceThe string to search.
valueThe string to locate within source .
Returns
The zero-based index of the first occurrence of value , if found, within source ; otherwise, -1. Returns 0 (zero) if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.

Definition at line 640 of file CompareInfo.cs.

◆ IndexOf() [3/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
char  value,
CompareOptions  options 
)
virtual

Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe character to locate within source .
optionsA value that defines how the strings should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the first occurrence of value , if found, within source , using the specified comparison options; otherwise, -1. Returns 0 (zero) if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 659 of file CompareInfo.cs.

◆ IndexOf() [4/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
string  value,
CompareOptions  options 
)
virtual

Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe string to locate within source .
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the first occurrence of value , if found, within source , using the specified comparison options; otherwise, -1. Returns 0 (zero) if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 679 of file CompareInfo.cs.

◆ IndexOf() [5/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
char  value,
int  startIndex 
)
virtual

Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the search.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that extends from startIndex to the end of source ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .

Definition at line 697 of file CompareInfo.cs.

◆ IndexOf() [6/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
string  value,
int  startIndex 
)
virtual

Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the search.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that extends from startIndex to the end of source ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .

Definition at line 716 of file CompareInfo.cs.

◆ IndexOf() [7/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
char  value,
int  startIndex,
CompareOptions  options 
)
virtual

Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that extends from startIndex to the end of source , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 738 of file CompareInfo.cs.

◆ IndexOf() [8/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
string  value,
int  startIndex,
CompareOptions  options 
)
virtual

Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that extends from startIndex to the end of source , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 761 of file CompareInfo.cs.

◆ IndexOf() [9/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
char  value,
int  startIndex,
int  count 
)
virtual

Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the search.
countThe number of elements in the section to search.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that starts at startIndex and contains the number of elements specified by count ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .

Definition at line 783 of file CompareInfo.cs.

◆ IndexOf() [10/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
string  value,
int  startIndex,
int  count 
)
virtual

Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the search.
countThe number of elements in the section to search.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that starts at startIndex and contains the number of elements specified by count ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .

Definition at line 802 of file CompareInfo.cs.

◆ IndexOf() [11/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
char  value,
int  startIndex,
int  count,
CompareOptions  options 
)
virtual

Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the search.
countThe number of elements in the section to search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that starts at startIndex and contains the number of elements specified by count , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 824 of file CompareInfo.cs.

◆ IndexOf() [12/12]

virtual int System.Globalization.CompareInfo.IndexOf ( string  source,
string  value,
int  startIndex,
int  count,
CompareOptions  options 
)
virtual

Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the search.
countThe number of elements in the section to search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the first occurrence of value , if found, within the section of source that starts at startIndex and contains the number of elements specified by count , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 867 of file CompareInfo.cs.

◆ IsPrefix() [1/2]

virtual bool System.Globalization.CompareInfo.IsPrefix ( string  source,
string  prefix,
CompareOptions  options 
)
virtual

Determines whether the specified source string starts with the specified prefix using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search in.
prefixThe string to compare with the beginning of source .
optionsA value that defines how source and prefix should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
true if the length of prefix is less than or equal to the length of source and source starts with prefix ; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- prefix is null.
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 525 of file CompareInfo.cs.

◆ IsPrefix() [2/2]

virtual bool System.Globalization.CompareInfo.IsPrefix ( string  source,
string  prefix 
)
virtual

Determines whether the specified source string starts with the specified prefix.

Parameters
sourceThe string to search in.
prefixThe string to compare with the beginning of source .
Returns
true if the length of prefix is less than or equal to the length of source and source starts with prefix ; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- prefix is null.

Definition at line 559 of file CompareInfo.cs.

◆ IsSortable() [1/2]

static bool System.Globalization.CompareInfo.IsSortable ( char  ch)
static

Indicates whether a specified Unicode character is sortable.

Parameters
chA Unicode character.
Returns
true if the ch parameter is sortable; otherwise, false.

Definition at line 203 of file CompareInfo.cs.

◆ IsSortable() [2/2]

static bool System.Globalization.CompareInfo.IsSortable ( string  text)
static

Indicates whether a specified Unicode string is sortable.

Parameters
textA string of zero or more Unicode characters.
Returns
true if the str parameter is not an empty string ("") and all the Unicode characters in str are sortable; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionstr is null.

Definition at line 216 of file CompareInfo.cs.

◆ IsSuffix() [1/2]

virtual bool System.Globalization.CompareInfo.IsSuffix ( string  source,
string  suffix,
CompareOptions  options 
)
virtual

Determines whether the specified source string ends with the specified suffix using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search in.
suffixThe string to compare with the end of source .
optionsA value that defines how source and suffix should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal used by itself, or the bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
true if the length of suffix is less than or equal to the length of source and source ends with suffix ; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- suffix is null.
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 577 of file CompareInfo.cs.

◆ IsSuffix() [2/2]

virtual bool System.Globalization.CompareInfo.IsSuffix ( string  source,
string  suffix 
)
virtual

Determines whether the specified source string ends with the specified suffix.

Parameters
sourceThe string to search in.
suffixThe string to compare with the end of source .
Returns
true if the length of suffix is less than or equal to the length of source and source ends with suffix ; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- suffix is null.

Definition at line 611 of file CompareInfo.cs.

◆ LastIndexOf() [1/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
char  value 
)
virtual

Searches for the specified character and returns the zero-based index of the last occurrence within the entire source string.

Parameters
sourceThe string to search.
valueThe character to locate within source .
Returns
The zero-based index of the last occurrence of value , if found, within source ; otherwise, -1.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 915 of file CompareInfo.cs.

◆ LastIndexOf() [2/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
string  value 
)
virtual

Searches for the specified substring and returns the zero-based index of the last occurrence within the entire source string.

Parameters
sourceThe string to search.
valueThe string to locate within source .
Returns
The zero-based index of the last occurrence of value , if found, within source ; otherwise, -1.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.

Definition at line 932 of file CompareInfo.cs.

◆ LastIndexOf() [3/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
char  value,
CompareOptions  options 
)
virtual

Searches for the specified character and returns the zero-based index of the last occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe character to locate within source .
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the last occurrence of value , if found, within source , using the specified comparison options; otherwise, -1.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 951 of file CompareInfo.cs.

◆ LastIndexOf() [4/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
string  value,
CompareOptions  options 
)
virtual

Searches for the specified substring and returns the zero-based index of the last occurrence within the entire source string using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe string to locate within source .
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the last occurrence of value , if found, within source , using the specified comparison options; otherwise, -1.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 971 of file CompareInfo.cs.

◆ LastIndexOf() [5/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
char  value,
int  startIndex 
)
virtual

Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the backward search.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that extends from the beginning of source to startIndex ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .

Definition at line 989 of file CompareInfo.cs.

◆ LastIndexOf() [6/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
string  value,
int  startIndex 
)
virtual

Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the backward search.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that extends from the beginning of source to startIndex ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .

Definition at line 1004 of file CompareInfo.cs.

◆ LastIndexOf() [7/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
char  value,
int  startIndex,
CompareOptions  options 
)
virtual

Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the backward search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that extends from the beginning of source to startIndex , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 1022 of file CompareInfo.cs.

◆ LastIndexOf() [8/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
string  value,
int  startIndex,
CompareOptions  options 
)
virtual

Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the backward search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that extends from the beginning of source to startIndex , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 1041 of file CompareInfo.cs.

◆ LastIndexOf() [9/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
char  value,
int  startIndex,
int  count 
)
virtual

Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the backward search.
countThe number of elements in the section to search.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that contains the number of elements specified by count and that ends at startIndex ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .

Definition at line 1059 of file CompareInfo.cs.

◆ LastIndexOf() [10/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
string  value,
int  startIndex,
int  count 
)
virtual

Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the backward search.
countThe number of elements in the section to search.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that contains the number of elements specified by count and that ends at startIndex ; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .

Definition at line 1078 of file CompareInfo.cs.

◆ LastIndexOf() [11/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
char  value,
int  startIndex,
int  count,
CompareOptions  options 
)
virtual

Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe character to locate within source .
startIndexThe zero-based starting index of the backward search.
countThe number of elements in the section to search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that contains the number of elements specified by count and that ends at startIndex , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 1100 of file CompareInfo.cs.

◆ LastIndexOf() [12/12]

virtual int System.Globalization.CompareInfo.LastIndexOf ( string  source,
string  value,
int  startIndex,
int  count,
CompareOptions  options 
)
virtual

Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index using the specified T:System.Globalization.CompareOptions value.

Parameters
sourceThe string to search.
valueThe string to locate within source .
startIndexThe zero-based starting index of the backward search.
countThe number of elements in the section to search.
optionsA value that defines how source and value should be compared. options is either the enumeration value F:System.Globalization.CompareOptions.Ordinal, or a bitwise combination of one or more of the following values: F:System.Globalization.CompareOptions.IgnoreCase, F:System.Globalization.CompareOptions.IgnoreSymbols, F:System.Globalization.CompareOptions.IgnoreNonSpace, F:System.Globalization.CompareOptions.IgnoreWidth, and F:System.Globalization.CompareOptions.IgnoreKanaType.
Returns
The zero-based index of the last occurrence of value , if found, within the section of source that contains the number of elements specified by count and that ends at startIndex , using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character.
Exceptions
T:System.ArgumentNullExceptionsource is null.-or- value is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for source .-or- count is less than zero.-or- startIndex and count do not specify a valid section in source .
T:System.ArgumentExceptionoptions contains an invalid T:System.Globalization.CompareOptions value.

Definition at line 1155 of file CompareInfo.cs.

◆ ToString()

override string System.Globalization.CompareInfo.ToString ( )

Returns a string that represents the current T:System.Globalization.CompareInfo object.

Returns
A string that represents the current T:System.Globalization.CompareInfo object.

Definition at line 1331 of file CompareInfo.cs.

Member Data Documentation

◆ LCID

int System.Globalization.CompareInfo.LCID => CultureInfo.GetCultureInfo(Name).LCID

Gets the properly formed culture identifier for the current T:System.Globalization.CompareInfo.

Returns
The properly formed culture identifier for the current T:System.Globalization.CompareInfo.

Definition at line 86 of file CompareInfo.cs.

Property Documentation

◆ Name

virtual string System.Globalization.CompareInfo.Name
get

Gets the name of the culture used for sorting operations by this T:System.Globalization.CompareInfo object.

Returns
The name of a culture.

Definition at line 72 of file CompareInfo.cs.

◆ Version

SortVersion? System.Globalization.CompareInfo.Version
get

Gets information about the version of Unicode used for comparing and sorting strings.

Returns
An object that contains information about the Unicode version used for comparing and sorting strings.

Definition at line 102 of file CompareInfo.cs.


The documentation for this class was generated from the following file: