String.Compare Method compares substrings of two specified String
Imports System Imports Microsoft.VisualBasic Class Sample Public Shared Sub Main() Dim str1 As [String] = "machine" Dim str2 As [String] = "device" Dim str As [String] Dim result As Integer result = [String].Compare(str1, 2, str2, 0, 2) str = IIf(result < 0, "less than", IIf(result > 0, "greater than", "equal to")) Console.Write("{0} ", str) End Sub 'Main End Class 'Sample