I am horrible with Regex stuff. I would like to use a regular expression in C# to turn any two or more spaces into non-breaking spaces. I would like to leave single spaces alone.
Sample Sample
Would produce
Sample Sample
But
Sample Sample
Wouldn’t be affected.
Any ideas?
Thanks in advance.
You can use a
MatchEvaluatoras the replacement argument. In C# 3.0 or newer you can use a lambda function: