Hmm... ok I quickly wrote a regex function that splits all the words and then increments the length var when if finds the specified word. Here's the function, add it:
Function FindLength( ByVal inputstring As String , ByVal wordtoFind As String )
Dim f As String = inputstring
Dim len As Integer = 0
Dim w () As String = Regex.Split( f , "\W+",RegexOptions.IgnoreCase)
If Not w .Length > 0 Then
Exit Function
End If
For Each q As String In w
If Not q = vbNullString Then
If q = wordtoFind Then
len + = 1
End If
End If
Next
Return len
End Function
Usage:
MsgBox(FindLength( "Hi my name is Hi. What is your name? Hi", "Hi"))
^^ Returns '3'. Hope this helps ^_~