I have a sequence of characters (eg. "}çæø Ñ ") and I need to obtain a char,count pair, where char is the ASCII character code and count is the number of consecutive repetitions of that same character.
The above sequence would thus read:
<125,1>
<135,1>
<145,1>
<32,5>
<155,1>
<32,3>
Is there a quick way of doing that with a Dictionary?
I need to ONLY count adjacent characters (see character 32 in the above example). I understand that Dictionaries can't have key repetitions, so is there another quick way that doesn't involve string iteration? I might have very long strings to process and iteration takes way too long.