String.IsNormalized Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Indicates whether this string is in Unicode normalization form C.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

member IsNormalized : unit -> bool

Return Value

Type: System.Boolean

true if this string is in normalization form C; otherwise, false.

Exception Condition
ArgumentException

The current instance contains invalid Unicode characters.

Some Unicode characters have multiple equivalent binary representations consisting of sets of combining and/or composite Unicode characters. The existence of multiple representations for a single character complicates searching, sorting, matching, and other operations.

The Unicode standard defines a process called normalization that returns one binary representation when given any of the equivalent binary representations of a character. Normalization can be performed with several algorithms, called normalization forms, that obey different rules. The .NET Framework currently supports normalization forms C, D, KC, and KD.

For a description of supported Unicode normalization forms, see System.Text.NormalizationForm.

Notes to Callers:

The IsNormalized method returns false as soon as it encounters the first non-normalized character in a string. Therefore, if a string contains non-normalized characters followed by invalid Unicode characters, the Normalize method will throw an ArgumentException although IsNormalized returns false.

The following example determines whether a string is successfully normalized to various normalization forms.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: