js replace characters in a string

JavaScript
var str = "Original string!";
var str = str.replace("Original", "New");str.replace(/abc/g, '');str.replace(/hello/g, 'hi');
// the g is to show it's a global change, not one-time change.

str.replace(new RegExp('hello', 'g'), 'hi');
Source

Also in JavaScript: