Public Function GetNthIndexStringFunc(s As String, t As String, n As Integer) As Integer
Dim newFound As Integer = -1
For i As Integer = 1 To n
newFound = s.IndexOf(t, newFound + 1)
Dim SearchString As String = "!!2!3!4!!!7!8!!"
Dim SearchChar As String = "!"
TestPos = GetNthIndexStringFunc(SearchString, SearchChar, 9)
Console.WriteLine("9nd Occurrence is at " & TestPos)
Console.WriteLine("String final: " & Microsoft.VisualBasic.strings.Mid(SearchString, 1, TestPos))