Hi I want to search about some characters (or word) in text using JavaScript and remove the line that starts this characters/word..
example
remove the lines that start with ( He ) ..
input
Hello world,
He like cats and dogs
Bye bye
output
Hello world,
Bye bye
You can find the pos of the “He ” using the indexOf method and then get the position of the next line-break to remove that line using the substring method.
jsFiddle here : http://jsfiddle.net/zw2Gh/