Imports System
Public Class Test
Public Shared Sub Main()
Dim count_chars As Integer() = New Integer(255) {} ' 256 = ASCII table size
Dim str As String = "bbaddddccce"
For i As Integer = 0 To str.Length - 1
count_chars(Convert.ToInt32(str(i))) += 1
Next
For i As Integer = 0 To 256 - 1
If count_chars(i) > 0 Then
Console.WriteLine(i & " " & count_chars(i))
End If
Next
End Sub
End Class
' run:
'
' 97 1
' 98 2
' 99 3
' 100 4
' 101 1
'