Use String.Compare to check if a URI is a file URI : String Compare « Data Type « VB.Net Tutorial






Public Class SamplesCompareInfo

   Public Shared Sub Main()

   End Sub

 Shared Function IsFileURI(ByVal path As String) As Boolean
    If String.Compare(path, 0, "file:", 0, 5, StringComparison.OrdinalIgnoreCase) = 0 Then
       Return True
    Else
       Return False
    End If

 End Function
 
End Class








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.