how to replace a character in javascript function code example Example: replace all javascript str.split(search).join(replacement);