Every line of 'remove word from string javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
155 function removeFirstWord(str, word) { 156 if (word === void 0) { word = ""; } 157 if (!word) { 158 word = getFirstWord(str); 159 } 160 var index = str.indexOf(word); 161 if (index == -1) 162 return str; 163 return str.substring(index + word.length); 164 }