How to make IndexOf VB.NET display word count rather than character count
I have a basic piece of code.
Sub Main()
Dim Test As String = "test example"
Console.WriteLine(Test.IndexOf("example"))
Console.ReadLine()
End Sub
The output would be "5" as the position of the start of the specified string is 5. I would still like to use indexof but how can i make it find the word location of the specified string such as it would output "2" as the word location is the 2nd word.