C# String IsNormalized(NormalizationForm)

Description

String IsNormalized(NormalizationForm) indicates whether this string is in the specified Unicode normalization form.

Syntax

String.IsNormalized(NormalizationForm) has the following syntax.


public bool IsNormalized(
  NormalizationForm normalizationForm
)

Parameters

String.IsNormalized(NormalizationForm) has the following parameters.

  • normalizationForm - A Unicode normalization form.

Returns

String.IsNormalized(NormalizationForm) method returns true if this string is in the normalization form specified by the normalizationForm parameter; otherwise, false.

Example

The following example demonstrates the IsNormalized and Normalize methods.


/*from w  ww.  ja  v a2 s .  c  o  m*/

using System;
using System.Text;

class Sample 
{
    public static void Main() 
    {
        string s1 = new String( new char[] {'\u0063', '\u0301', '\u0327', '\u00BE'});
        string s2 = null;
    
        Console.WriteLine(s1.IsNormalized(NormalizationForm.FormC));
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version