Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Return the index of the string

Option Strict On  Imports System  Class Tester      Public Shared Sub Main( )          Dim s1 As String = "abcd"          Dim s2 As String = "ABCD"          Dim s3 As String = "AAAAs "          s3 = s3 & "development"          Console.WriteLine("s3: {0}", s3)                    Console.Write("The first occurrence of a ")          Console.WriteLine(s3.IndexOf("a"))      End Sub 'Main  End Class 'Tester s3: AAAAs development The first occurrence of a -1