Compare String value in If statement : String Compare « Data Type « VB.Net Tutorial






Module Module1

    Sub Main()

        Dim Language As String = "English"

        If (Language = "English") Then
            Console.WriteLine("Hello, world!")
        ElseIf (Language = "Spanish") Then
            Console.WriteLine("Hola, mundo")
        End If


    End Sub

End Module
Hello, world!








2.31.String Compare
2.31.1.Comparing strings: Equals, =, String.Equals() and CompareTo
2.31.2.String Equals with overloaded operator, member method and static member method
2.31.3.String Compare with case sensitive and insensitive
2.31.4.Compare String value in If statement
2.31.5.Whether a string is the prefix or suffix of another string.
2.31.6.Use the CompareTo method with another String.
2.31.7.Use String.Compare to check if a URI is a file URI
2.31.8.Compare two strings using different CompareOptions settings.