I want to replace repeated characters in a string with the number of times repeated and the character itself: e.g. bo$bbo$ooo! becomes bo$2bo$3o! It will only apply to b and o. Every solution I have come up with hasn't worked and seems very complicated compared to the task and ends up not working, is there any quick way to do this? Continue reading...