replace one part of a string with another js code example Example: replace each string by another string javascript str.split(search).join(replacement)