Module Module1 Public Class Tester Public Sub Run() 'Create some strings to work with Dim s1 As String = "http://www.bbc.co.uk" Dim s2 As String Dim s3 As String Dim index As String 'Substring method takes 2 parameters: from index (Inclusicve) and To index (Exclusive) 'Search for first substring s2 = s1.Substring(0, 4) Console.WriteLine(s2) 'Search for next substring index = s1.LastIndexOf("/") s2 = s1.Substring(index + 1, 3) Console.WriteLine(s2) 'Search for next substring index = s1.IndexOf(".") s2 = s1.Substring(index + 1) s3 = s2.Substring(0, 3) Console.WriteLine(s3) 'Search for next substring index = s2.IndexOf(".") s3 = s2.Substring(index + 1, 2) Console.WriteLine(s3) 'Search for last substring index = s1.LastIndexOf(".") s3 = s1.Substring(index + 1, 2) Console.WriteLine(s3) End Sub End Class Sub Main() Dim t As Tester = New Tester() t.Run() Console.ReadLine() End Sub End Module