If you use a regular expression it will do a more robust word separation.
Dim rex As New System.Text.RegularExpressions.Regex("\b[a-z|A-Z|']+\b")
Dim s As String = "the Quick, brown's <fox> jumped?"
For Each match As System.Text.RegularExpressions.Match In rex.Matches(s)
Debug.WriteLine(s.Substring(match.Index, match.Length))
Next
In the above regular expression "\b" matches a word boundary. "[a-z|A_Z|']" matches a word of any case letters and an apostrophe. I'm not sure if my regular expression is the most suitable for what you want but it seems to work. Just replace "s" with your current line and go nuts. For more info see http://www.regular-expressions.info/reference.html
Reverend Jim
Posting Shark
1,169 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159