If a character occurs more than once in the second argument string, then the first occurrence determines the replacement character.
Tariq Dweik