javascript - Remove Lines Containing using jquery -
i want create remove lines containing using jquery, here code:
<body> search lines for: <input type="text" id="search-lines" value="sometimes|relevance|understand" style="width:100%; margin-top:10px;" /> <button id="process">process!</button> <textarea id="input" style="width:100%; margin-top:10px; height:150px; resize:none;" wrap="off">sometimes understand word's meaning need more definition. @ dictionary try give of tools need understand word means. seeing word in sentence can provide more context , relevance.</textarea> <textarea id="containing-output" rows="4" style="width:100%; margin-top:10px; height:150px; resize:none;" wrap="off"></textarea> <textarea id="not-contating-output" rows="4" style="width:100%; margin-top:10px; height:150px; resize:none;" wrap="off"></textarea> </body>
this how works:
search lines for:
sometimes|relevance|understand
text lines input:
sometimes understand word's
meaning need more definition.
at dictionary try give of tools
you need understand word means.
seeing word in sentence can
provide more context , relevance.
containing lines output:
sometimes understand word's
you need understand word means.
provide more context , relevance.
not-containing lines output:
meaning need more definition.
at dictionary try give of tools
seeing word in sentence can
you can use array
var unwantedwords= array( //create array of list of words )
var sometext = "sometimes understand word's"; // here string
then loop through array , check values , remove string
for (index = 0; index < unwantedwords.length; ++index) { var word = unwantedwords[index ]; var check = sometext.indexof(word) if(check !== false) { removedwordstring = sometext.replace(word,''); } }
Comments
Post a Comment