C# String Normalize()

Description

String Normalize() returns a new string whose textual value is the same as this string, but whose binary representation is in Unicode normalization form C.

Syntax

String.Normalize() has the following syntax.


public string Normalize()

Returns

String.Normalize() method returns A new, normalized string whose textual value is the same as this string, but whose binary representation is in normalization form C.

Example

This example demonstrates the String.Normalize method and the String.IsNormalized method.


/*  w  w w.j  a  va 2  s . c om*/
using System;
using System.Text;

class Sample 
{
    public static void Main() 
    {
        string s1 = "\u0063\u0301\u0327\u00BE";
        string s2 = null;
    
        s2 = s1.Normalize();
        Console.WriteLine(s2.IsNormalized());
    }
}

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