i have the following problem Given a string, return a \"cleaned\" string where adjacent chars that are the same have been reduced to a single char. So \"yyzzza\">
\"yyzzza\">
function cleanString(toClean){ return toClean.replace(/(\S)\1(\1)*/g,"$1") }
Demo in jsFiddle