How to find the index of the first occurrence of one string within another from specific index in VB.NET

1 Answer

0 votes
Imports System

Public Class Test
    Public Shared Sub Main()
        Dim s As String = "java vb.net python c# c++ vb.net c vb.net"

        Dim search As String = "vb"
        Dim start_index As Integer = 7

        Dim index As Integer = InStr(start_index, s, search, CompareMethod.Text)
        
        Console.WriteLine(index)
    End Sub
End Class



' run:
'
' 27
'

 



answered Nov 19, 2021 by avibootz
...