var str = "substr1 substr2 substr3" str = str.replace(" substr2", '') //"substr1 substr3"
str.split(" substr2").join('') //"substr1 substr3"