I want to replace any space between in word in with dash in C#. But my problem is when I want remove space in sample string like this:
"a b"
or
"a b"
When I try this, I get this result:
"a--b" and "a---b"
How can I put one dash for any count of space between the word?
Like this:
"a b"
"a-b"