One way to do this would be to Split the String. Now it is in an array.
Then you could sort the array (Array.Sort (arrayName) and loop through
counting the number of times consecutive elements are the same.
Something like this:
Dim Words() as String = Split(TextString)
Dim Count(Words.Length -1) as Integer
Dim CountIndex as Integer = 0
Dim PrevWord as String
PrevWord = Words(0)
For i as Integer = 1 to Words.Length - 1
If Words(i) <> PrevWord Then
CountIndex +=1
End If
Count(CountIndex) += 1
PrevWord = Word(i)
Next
Hope that helps,
--
Marc Butenko
mb******@bresnan.net
"Burak" <bu*********@xpandcorp.com> wrote in message
news:b1**************************@posting.google.c om...
Hello,
I will start working on a project where we have to parse a string and
store the words and the number of times each word appears.
I know you can use the Split function to split a string into words
and then I'd have to savethe words and keep a track of how many times
each one appears.
Does .NET already have a way to do this?
Thank you,
Burak