View Source... The replaceCharacters() function is used to replace some characters with some other characters in a string; it is case sensitive. It is NOT a native JavaScript builtin. Replacements do not have to be 1 character for 1 character, as shown in the demo.