Your technology certification is waiting. Enroll in Cloud Class ®
Dim strSample As String = "one, two, three, four, five, two, one,six,seven"
Dim alCountWords As New ArrayList
Dim htTimes As New Hashtable
Dim vecWords() As String
Dim intWord As Integer
Dim strWord As String
vecWords = strSample.Split(",")
For intWord = 0 To vecWords.Length - 1
strWord = vecWords(intWord).Trim
If alCountWords.Contains(strWord) Then
htTimes(strWord) = Int32.Parse(htTimes(strWord).ToString) + 1
Dim strResults As String = ""
For intWord = 0 To alCountWords.Count - 1
If htTimes(alCountWords(intWord)) > 1 Then
strResults &= alCountWords(intWord) & ","
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.