System.Globalization.CompareOptions Enumeration

Assembly: Mscorlib.dll
Namespace: System.Globalization
Summary
Defines the string comparison options to use with CompareInfo.
C# Syntax:
[Flags]
[Serializable]
public enum CompareOptions
Remarks
These options denote case sensitivity or whether to ignore types of characters.

The CompareOptions.StringSort value can only be used with CompareInfo.Compare and CompareInfo.GetSortKey. ArgumentException is thrown if the CompareOptions.StringSort value is used with CompareInfo.IsPrefix, CompareInfo.IsSuffix, CompareInfo.IndexOf, or CompareInfo.LastIndexOf.

See also:
System.Globalization Namespace See also:
MSDN: basicstringoperations

System.Globalization.CompareOptions Member List:

Public Fields
IgnoreCase Indicates that the string comparison must ignore case.
IgnoreKanaType Indicates that the string comparison must ignore the Kana type. Kana type refers to Japanese hiragana and katakana characters, which represent phonetic sounds in the Japanese language. Hiragana is used for native Japanese expressions and words, while katakana is used for words borrowed from other languages, such as "computer" or "Internet". A phonetic sound can be expressed in both hiragana and katakana. If this value is selected, the hiragana character for one sound is considered equal to the katakana character for the same sound.
IgnoreNonSpace Indicates that the string comparison must ignore nonspacing combining characters, such as diacritics. The Unicode Standard defines combining characters as characters that are combined with base characters to produce a new character. Nonspacing combining characters do not occupy a spacing position by themselves when rendered. For more information on nonspacing combining characters, see The Unicode Standard at http://www.unicode.org.
IgnoreSymbols Indicates that the string comparison must ignore symbols, such as white-space characters, punctuation, currency symbols, the percent sign, mathematical symbols, the ampersand, and so on.
IgnoreWidth Indicates that the string comparison must ignore the character width. For example, Japanese katakana characters can be written as full-width or half-width and, if this value is selected, the katakana characters written as full-width are considered equal to the same characters written in half-width.
None Indicates the default option settings for string comparisons.
Ordinal Indicates that the string comparison must be done using the Unicode values of each character, which is a fast comparison but is culture-insensitive. A string starting with "U+xxxx" comes before a string starting with "U+yyyy", if xxxx is less than yyyy.
StringSort Indicates that the string comparison must use the string sort algorithm, where the hyphen and the apostrophe, as well as other nonalphanumeric characters, come before alphanumeric symbols.

Hierarchy:


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.