Basically, I want to take a string, and if there are multiple '+'s in a row, i want to remove all but 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 something else would be best suited, but it doesn't have to use any particular method.
Regex.Replace(str, @"\++", "+");
while (str.Contains("++"))
str = str.Replace("++", "+");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With