Imports System
Imports System.Text
Imports Microsoft.VisualBasic
Class Sample
Public Shared Sub Main()
Dim s1 = New [String](New Char() {ChrW(&H0063), ChrW(&H0301), ChrW(&H0327), ChrW(&H00BE)})
Dim s2 As String = Nothing
Try
Show("s1", s1)
Console.WriteLine("A1) Is s1 normalized to the default form (Form C)?: {0}", s1.IsNormalized())
Console.WriteLine("A2) Is s1 normalized to Form C?: {0}", s1.IsNormalized(NormalizationForm.FormC))
Console.WriteLine("A3) Is s1 normalized to Form D?: {0}", s1.IsNormalized(NormalizationForm.FormD))
Console.WriteLine("A4) Is s1 normalized to Form KC?: {0}", s1.IsNormalized(NormalizationForm.FormKC))
Console.WriteLine("A5) Is s1 normalized to Form KD?: {0}", s1.IsNormalized(NormalizationForm.FormKD))
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub
Private Shared Sub Show(title As String, s As String)
Console.Write("Characters in string {0} = ", title)
Dim x As Char
For Each x In s.ToCharArray()
Console.Write("{0:X4} ", AscW(x))
Next x
Console.WriteLine()
End Sub
End Class