calling the Compare method.
Imports System
Imports System.Text
Imports System.Globalization
NotInheritable Public Class App
Shared Sub Main(ByVal args() As String)
Dim sign() As String = {"<", "=", ">"}
Dim s1 As String = "A"
Dim s2 As String = "B"
Dim s3 As String = "C"
Dim ci As CompareInfo = New CultureInfo("fr-FR").CompareInfo
Console.WriteLine("The LCID for {0} is {1}.", ci.Name, ci.LCID)
Console.WriteLine("fr-FR Compare: {0} {2} {1}",s1, s2, sign((ci.Compare(s1, s2, CompareOptions.IgnoreCase) + 1)))
Console.WriteLine("fr-FR Compare: {0} {2} {1}",s2, s3, sign((ci.Compare(s2, s3, CompareOptions.None) + 1)))
ci = New CultureInfo("ja-JP").CompareInfo
Console.WriteLine("The LCID for {0} is {1}.", ci.Name, ci.LCID)
Console.WriteLine("ja-JP Compare: {0} {2} {1}", s2, s3, sign((ci.Compare(s2, s3) + 1)))
End Sub
End Class
Related examples in the same category