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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -