What is the most efficient way to detect if a string contains a number of consecutive duplicate char

Posted by silent on Stack Overflow See other posts from Stack Overflow or by silent
Published on 2010-04-19T21:59:40Z Indexed on 2010/04/19 22:53 UTC
Read the original article Hit count: 113

Filed under:
|

For example, a user entered "I love this post!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"

the consecutive duplicate exclamation mark "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" should be detected.

© Stack Overflow or respective owner

Related posts about c#

Related posts about string-manipulation