c# - Reduce multiple consecutive equal characters from a string to just one -
basically, want take string, , if there multiple '+'s in row, want remove one. so:
"this++is+an++++ex+ampl++e"
would become
"this+is+an+ex+ampl+e"
i'm not sure whether linq or regex or else best suited, doesn't have use particular method.
regex.replace(str, @"\++", "+");
Comments
Post a Comment