Hi,
Maybe this will help. The hash table has a key for each item. When
I add an item to the hash table I use the word as a key and value. I use
the hash tables containskey method to see if the word is new.
Dim strTest As String = "one two three four five one two three six
five"
Dim ht As New Hashtable
For Each strWord As String In strTest.Split(" "c)
Try
If Not ht.ContainsKey(strWord) Then
ht.Add(strWord, strWord)
End If
Catch ex As Exception
Trace.WriteLine(ex.ToString)
End Try
Next
Dim de As DictionaryEntry
For Each de In ht
Trace.WriteLine(de.Value)
Next
Ken
------------------
<al*****@altavista.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hi everyone,
Hope that you can help me please? I have a string of the form:
wordA wordB wordC wordD etc etc
I want to de-duplicate it- that is, I want to remeove any repeated
term (leaving only 1 occurance of all terms).
What is the fastest way? I have lots of strings of this nature to
parse! Should I use a arraylist perhaps? Does VB.NET have a dedicated
method for doing this?
Any comments/suggestions/code-samples much,. much appreciated.
Thank you,
Al