add substitute function for repeated characters
Merge pull request #5 from yasaichi/deal-with-repeated-characters

add substitute function for repeated characters