Change string case using the English-United States and Turkish-Turkey cultures and then compare : String Functions « Data Type « VB.Net Tutorial






' Sample for String.ToUpper(CultureInfo)
Imports System
Imports System.Globalization
Imports Microsoft.VisualBasic

Class Sample

   Public Shared Sub Main()
      Dim str1 As [String] = "idea"
      Dim str2, str3 As [String]

      Console.WriteLine("str2 = Upper case copy of str1 using English-United States culture.")
      str2 = str1.ToUpper(New CultureInfo("en-US", False))

      Console.WriteLine("str3 = Upper case copy of str1 using Turkish-Turkey culture.")
      str3 = str1.ToUpper(New CultureInfo("tr-TR", False))

      Console.WriteLine("str2 is {0} to str3.", IIf(0 = [String].CompareOrdinal(str2, str3), "equal", "not equal"))
      DeCode(str1)
      
      DeCode(str2)
      DeCode(str3)
   End Sub

   Public Shared Sub DeCode( s As [String])
      Dim c As Char
      For Each c In  s
         Console.Write("{0:x4} ", AscW(c))
      Next c
      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)