delete specific word in string javascript code example
Example 1: javascript remove line breaks from string
var stringWithLineBreaks = `
O boy
I've got
Breaks
`;
var stringWithoutLineBreaks = stringWithLineBreaks.replace(/(\r\n|\n|\r)/gm, "");
Example 2: How to remove text from a string in javscript
var ret = "data-123".replace('data-','');
console.log(ret);
Example 3: how to remove a text by javascript
var ret = "data-123".replace('data-','');
Example 4: js remove ta contin word
$('div:contains("word2")').remove();