Determines whether a string is normalized to various normalization forms(String.Normalize and the String.IsNormalized method) : String Functions « Data Type « VB.Net Tutorial






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








2.38.String Functions
2.38.1.Passing String values to Val
2.38.2.Passing formatted numeric values to Val
2.38.3.IsNumeric, IsDate, IsNothing
2.38.4.Duplicate a string
2.38.5.Get string index by using InStr
2.38.6.CStr: Convert Double to String
2.38.7.Len: get string length
2.38.8.Instr
2.38.9.IsDBNull
2.38.10.Microsoft.VisualBasic.Left
2.38.11.String.Copy
2.38.12.Use String.Concat to concatenate two strings
2.38.13.Format: c
2.38.14.String handling function: Len
2.38.15.Left: get characters from left
2.38.16.Right: get characters from right
2.38.17.Mid(string, 4, 5): get sub string from middle
2.38.18.Mid(string, 7): get sub string from start
2.38.19.Instr: find character in a string
2.38.20.Instr: find sub string a in a string
2.38.21.LCase: change string to lower case
2.38.22.UCase: change string to upper case
2.38.23.Change string case using the English-United States and Turkish-Turkey cultures and then compare
2.38.24.Determines whether a string is normalized to various normalization forms(String.Normalize and the String.IsNormalized method)