0

Count Equal Numbers in Text box How ?

Hey guys,
I want to Know is there any way to Count Similar Numbers which entered in single textbox in VB6

as a example; i have textbox named txt1 in that user can type any value (2,12,23,2,34,12,2,2,23,54,12....) (separate the values by adding ",").when the user click the command button, i want to get the Count of those Numbers to in a textbox or label.(like or Eg : 2's are=4, 12's are =3, 23's are =2.. Etc..

i searched over the internet and found Not Proper Result. plese help me... Thank U.

3
Contributors
4
Replies
21
Views
3 Years
Discussion Span
Last Post by Reverend Jim
0

Assuming the numbers are separated by a comma, you could split the string into separate numeric string by

Dim nums() As String = tbx.Nums.Text.Split(",")

Then you could create a dictionary, iterate over the strings and add/increment the count for each unique string in the dictionary.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.