I want to replace the second occurrence of a letter in a double letter pair with a specified code. For example, if the code is a capital letter
"X", then the input
"hello, this is silly"
"helXo, this is silXy."
I can replace the entire pair with something like
StringReplace["hello, this is silly", x_ ~~ x_ -> "X"]
but how do I replace only the second member of the pair?