Code: (Select All)
Print OrderIt("apple")
Print OrderIt("cheeseburger")
Function OrderIt$ (word$)
Dim temp(255) As _Byte
For i = 1 To Len(word$)
a = Asc(word$, i)
temp(a) = temp(a) + 1
Next
For j = 0 To 255
o$ = o$ + String$(temp(j), j)
Next
OrderIt$ = o$
End Function
And that's all there is to it!
Edit: @bplus I bet this is faster than yours, as all it does is create a simple array and then directly stores the values in that array. No string counting, positioning, or manipulation needed here! Jst count, then build.