str.replace(/abc/g, '');
function replaceAll(string, search, replace) {
return string.split(search).join(replace);
}
const output = replaceAll(Url, type, changeType);
function name(str,replaceWhat,replaceTo){
replaceWhat = replaceWhat.replace(/[-/^$*+?.()|[]{}]/g, '$&');
var re = new RegExp(replaceWhat, 'g');
return str.replace(re,replaceTo);
}
function name(str,replaceWhat,replaceTo){
var re = new RegExp(replaceWhat, 'g');
return str.replace(re,replaceTo);
}
/**
*A better method for replacing strings is as follows:
**/
function replaceString(oldString, newString, fullString) {
return fullS.split(oldS).join(newS)
}
replaceString('World', 'Web', 'Brave New World')//'Brave New Web'
replaceString('World', 'Web', 'World New World')//'Web New Web'