diff --git a/xml/System.Globalization/CompareInfo.xml b/xml/System.Globalization/CompareInfo.xml index 459b6408da9..de40845ea54 100644 --- a/xml/System.Globalization/CompareInfo.xml +++ b/xml/System.Globalization/CompareInfo.xml @@ -328,7 +328,7 @@ The first string to compare. The second string to compare. - A value that defines how and should be compared. is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , and . + A value that defines how and should be compared. is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , , and . Compares two strings using the specified value. A 32-bit signed integer indicating the lexical relationship between the two comparands. @@ -556,7 +556,7 @@ The zero-based index of the character in at which to start comparing. The second string to compare. The zero-based index of the character in at which to start comparing. - A value that defines how and should be compared. is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , and . + A value that defines how and should be compared. is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , , and . Compares the end section of a string with the end section of another string using the specified value. A 32-bit signed integer indicating the lexical relationship between the two comparands. @@ -811,7 +811,7 @@ The second string to compare. The zero-based index of the character in at which to start comparing. The number of consecutive characters in to compare. - A value that defines how and should be compared. is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , and . + A value that defines how and should be compared. is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , , and . Compares a section of one string with a section of another string using the specified value. A 32-bit signed integer indicating the lexical relationship between the two comparands. @@ -1554,7 +1554,7 @@ The string for which a object is obtained. - A bitwise combination of one or more of the following enumeration values that define how the sort key is calculated: , , , , , and . + A bitwise combination of one or more of the following enumeration values that define how the sort key is calculated: , , , , , , and . Gets a object for the specified string using the specified value. The object that contains the sort key for the specified string. @@ -2007,7 +2007,7 @@ Use value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. @@ -2188,7 +2188,7 @@ Use value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. A Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search, where the Unicode values are compared. @@ -2436,7 +2436,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. @@ -2633,7 +2633,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. A Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search, where the Unicode values are compared. @@ -2850,7 +2850,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. @@ -2963,7 +2963,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. A Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search, where the Unicode values are compared. @@ -3217,7 +3217,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -3725,7 +3725,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -4150,7 +4150,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. @@ -4337,7 +4337,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. A Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search, where the Unicode values are compared. @@ -4583,7 +4583,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. @@ -4780,7 +4780,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. A Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search, where the Unicode values are compared. @@ -4997,7 +4997,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. @@ -5110,7 +5110,7 @@ This method has greater overhead than other value is not valid for this method. + The and values are not valid for this method. If `options` does not include the value, this overload performs a culture-sensitive search. A Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search, where the Unicode values are compared. diff --git a/xml/System.Globalization/CompareOptions.xml b/xml/System.Globalization/CompareOptions.xml index 0651cdabb40..fe0e538e42b 100644 --- a/xml/System.Globalization/CompareOptions.xml +++ b/xml/System.Globalization/CompareOptions.xml @@ -79,8 +79,8 @@ In .NET 5 and later, the cross-platform ICU (International Components for Unicode) library is used for string processing. The ICU library brings the following changes to string comparison behavior: -- The default option `None` is now equivalent to the `StringSort` option. The previous functionality of `None`, where equal weighting was given to alphanumeric and nonalphanumeric characters, is no longer available. -- Ligatures (combined characters like "æ" and "œ") are now seen as distinct from their expanded forms ("ae", "oe") in string comparisons by default. To treat ligatures and their expanded forms as equivalent, use the `IgnoreNonSpace` option. +- The default option `None` is equivalent to the `StringSort` option. The previous functionality of `None`, where equal weighting was given to alphanumeric and nonalphanumeric characters, is no longer available. +- Ligatures (combined characters like "æ" and "œ") are seen as distinct from their expanded forms ("ae", "oe") in string comparisons by default. To treat ligatures and their expanded forms as equivalent, use the `IgnoreNonSpace` option. For more information about the change, including how to restore the previous Unicode handler, see [.NET globalization and ICU](/dotnet/core/extensions/globalization-icu). @@ -88,13 +88,13 @@ For more information about this API, see [Supplemental API remarks for CompareOp ## Examples -The following code example shows how each of the CompareOptions values affect string comparisons. +The following code example shows how each of the `CompareOptions` values affect string comparisons. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareOptions/Overview/compareoptions_values.cs" interactive="try-dotnet"::: :::code language="fsharp" source="~/snippets/fsharp/System.Globalization/compareoptions_values.fs"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareOptions/Overview/compareoptions_values.vb"::: -The following code example shows how sorting with StringSort differs from sorting without StringSort. +The following code example shows how sorting with `StringSort` differs from sorting without StringSort. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareOptions/Overview/compareoptions_stringsort.cs" interactive="try-dotnet"::: :::code language="fsharp" source="~/snippets/fsharp/System.Globalization/compareoptions_stringsort.fs"::: @@ -147,7 +147,7 @@ The following code example shows how sorting with StringSort differs from sortin 1 - Indicates that the string comparison ignores case differences. + A string comparison that ignores case differences. @@ -192,7 +192,7 @@ The following code example shows how sorting with StringSort differs from sortin 8 - Indicates that the string comparison ignores the kana type. Kana type refers to Japanese hiragana and katakana characters, which represent phonetic sounds. Hiragana is used for native Japanese words, while katakana is used for words borrowed from other languages. With this option, hiragana and katakana characters that represent the same sound are considered equal. + A string comparison that ignores the kana type. Kana type refers to Japanese hiragana and katakana characters, which represent phonetic sounds. Hiragana is used for native Japanese words, while katakana is used for words borrowed from other languages. With this option, hiragana and katakana characters that represent the same sound are considered equal. @@ -237,7 +237,7 @@ The following code example shows how sorting with StringSort differs from sortin 2 - Indicates that the string comparison ignores nonspacing combining characters, such as diacritics. Nonspacing characters modify base characters without occupying their own space. The Unicode Standard defines combining characters as characters that are combined with base characters to produce a new character. + A string comparison that ignores nonspacing combining characters, such as diacritics. Nonspacing characters modify base characters without occupying their own space. The Unicode Standard defines combining characters as characters that are combined with base characters to produce a new character. @@ -282,7 +282,7 @@ The following code example shows how sorting with StringSort differs from sortin 4 - Indicates that the string comparison ignores symbols, including whitespace, punctuation, currency symbols, the percent sign, mathematical symbols, the ampersand, and similar characters. + A string comparison that ignores symbols, including whitespace, punctuation, currency symbols, the percent sign, mathematical symbols, the ampersand, and similar characters. @@ -327,7 +327,7 @@ The following code example shows how sorting with StringSort differs from sortin 16 - Indicates that the string comparison ignores character width. For example, full-width and half-width forms of Japanese katakana characters are considered equal with this option. + A string comparison that ignores character width. For example, full-width and half-width forms of Japanese katakana characters are considered equal with this option. @@ -372,7 +372,7 @@ The following code example shows how sorting with StringSort differs from sortin 0 - Indicates the default option settings for string comparisons. + A string comparison with default option settings. @@ -402,9 +402,8 @@ The following code example shows how sorting with StringSort differs from sortin 32 - The option that specifies that string comparisons sort sequences of digits (Unicode general category "Nd") based on their numeric value. - For example, "2" comes before "10". Non-digit characters such as decimal points, minus, and plus signs - are not considered as part of the sequence and will terminate it. This flag is not valid for indexing methods (such as and ). + A string comparison that sorts sequences of digits (Unicode general category "Nd") based on their numeric value. + For example, "2" comes before "10". Non-digit characters such as decimal points, minus, and plus signs aren't considered as part of the sequence and will terminate it. This flag is not valid for indexing methods (such as and ). @@ -450,7 +449,7 @@ The following code example shows how sorting with StringSort differs from sortin 1073741824 - Indicates that the string comparison uses the Unicode UTF-16 encoded values of the strings, comparing them code unit by code unit. This results in a fast, culture-insensitive comparison where strings are ordered based only on their binary values. This option can't be combined with other values and must be used alone. + A string comparison that uses the Unicode UTF-16 encoded values of the strings, comparing them code unit by code unit. This results in a fast, culture-insensitive comparison where strings are ordered based only on their binary values. This option can't be combined with other values and must be used alone. @@ -494,7 +493,9 @@ The following code example shows how sorting with StringSort differs from sortin 268435456 - Indicates that the string comparison ignores case and then performs an ordinal comparison. This is equivalent to converting both strings to uppercase using the invariant culture and then performing the comparison. + A string comparison that ignores case, then performs an ordinal comparison. This technique is equivalent to converting the string to uppercase using the invariant culture and then performing an ordinal comparison on the result. + + This value can't be combined with other values and must be used alone. @@ -539,7 +540,7 @@ The following code example shows how sorting with StringSort differs from sortin 536870912 - Indicates that the string comparison uses the string sort algorithm, where nonalphanumeric symbols (such as hyphens and apostrophes) are sorted before alphanumeric characters. + A string comparison that uses the string sort algorithm, where nonalphanumeric symbols (such as hyphens and apostrophes) are sorted before alphanumeric characters. diff --git a/xml/System.Globalization/GlobalizationExtensions.xml b/xml/System.Globalization/GlobalizationExtensions.xml index c14b6aba58c..d7195c355f1 100644 --- a/xml/System.Globalization/GlobalizationExtensions.xml +++ b/xml/System.Globalization/GlobalizationExtensions.xml @@ -118,7 +118,7 @@ An object that supports culture-sensitive string comparison. - A value that defines how strings should be compared. is either the enumeration value , the enumeration value , or a bitwise combination of one or more of the following values: , , , , , and . + A value that defines how strings should be compared. is either the enumeration value , the enumeration value , or a bitwise combination of one or more of the following values: , , , , , , and . Returns a object based on the culture-sensitive string comparison rules of a specified object. An object that can be used to perform string comparisons. To be added.