Regex for replacing all consecutive dashes to single dash

D

DotNetNewbie

Hi,

I want to replace all consecutive (2 or more) dashes into a single
dash.

So text like "hello--world is-cool------ok?"

should become "hello-word is-cool-ok?"

so it doesn't effect anything except replace all consecutive dashes
into a single dash.

What would the regex look like?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top