calling the Compare method. : String Compare « Data Types « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Data Types » String CompareScreenshots 
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.IgnoreCase1)))

        Console.WriteLine("fr-FR Compare: {0} {2} {1}",s2, s3, sign((ci.Compare(s2, s3, CompareOptions.None1)))

        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, s31)))

    End Sub
End Class

   
    
  
Related examples in the same category
1.Compares two strings using different CompareOptions settings.
2.Compare string with CompareOptions.None
3.Compare With Ordinal
4.Compare With StringSort
5.Compare with With IgnoreCase
6.Compare With IgnoreSymbols
7.Compare With IgnoreCase and IgnoreSymbols
8.Compare two string ignoring case
9.Compare two strings case-sensitively
10.Sample for String.Compare(String, Int32, String, Int32, Int32, Boolean)
11.String.Equals(Object), String.Equals(String), String.Equals(String, String)
12.Generic and nongeneric versions of the CompareTo method for String value
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.