pseudocode:
string s = "sddfa233"
loop over the string from index 1
compare current character with the one before it
if they are equal, you have a match.