How do I coalesce a sequence of identical characters into just one?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-05-11T19:28:36Z Indexed on 2010/05/11 20:14 UTC
Read the original article Hit count: 190

Filed under:
|

Suppose I have this:

My---sun--is------very-big---.

I want to replace all multiple hyphens with just one hyphen.

© Stack Overflow or respective owner

Related posts about python

Related posts about string