Hi I'm trying to get the number of occurrences of a character out of a txtbox. Still haven't found the answer... For example: I give in a sentence... "Hello there!." and in a listbox there must be...
H - 2 times e - 3 times ....
this is my code...
For i = 0 To txtSent.Text.Length - 1
If (Char.IsLetter(txtSent.Text(i))) Then
Dim str = Len(txtSent.Text) - Len(Replace(txtSen.Text, txtSen.Text(i), ""))
lstOutput.Items.Add(txtZin.Text(i) & " occurs " & str & " time(s)")
End If
Next´
But i need it to be "m - 5" instead of repeating all the characters of "m"
Can you help me?