Imports System
Imports System.Globalization
Public Class SamplesCompareInfo
Public Shared Sub Main()
Dim myStr1 As [String] = "Bill's"
Dim myStr2 As [String] = "bills"
' Creates a CompareInfo that uses the InvariantCulture.
Dim myComp As CompareInfo = CultureInfo.InvariantCulture.CompareInfo
' Compares two strings using myComp.
Console.WriteLine("Comparing ""{0}"" and ""{1}""", myStr1, myStr2)
Console.WriteLine("With IgnoreCase and IgnoreSymbols : {0}", myComp.Compare(myStr1, myStr2, CompareOptions.IgnoreCase Or CompareOptions.IgnoreSymbols))
End Sub
End Class
|