How to find the location of a character or substring in string with VB.NET

2 Answers

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
		Dim str As String = "java vb.net c c++ python"
		
        Console.WriteLine(str.IndexOf("c"c))
    End Sub
End Class




' run:
'
' 12
'

 



answered Aug 3, 2022 by avibootz
0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
		Dim str As String = "java vb.net c c++ python"
		
        Console.WriteLine(str.IndexOf("c++"))
    End Sub
End Class




' run:
'
' 14
'

 



answered Aug 3, 2022 by avibootz
...