jQuery issue with removing lines from block of strings

gamelan1

New Member
I have got the following line of strings:\[code\]aaaaaaaa1bbbbbbbb2cccccccc3dddddddd4\[/code\]And this is my field:\[code\]<textarea id="myLinesField"></textarea>\[/code\]using jQuery, Having said that I am able to choose and remove any line (in any order), I am trying to remove specific lines from my lines say second line to have the exact result like the following:\[code\]aaaaaaaa1cccccccc3dddddddd4\[/code\]This is my code:\[code\]var value = http://stackoverflow.com/questions/15651812/$('#myLinesField').val();var newVal = recipientValue.replace(stringLineToBeRemoved,'');var finalResults = newVal.replace("\n", "");$('#myLinesField').val(finalResults);\[/code\]But I get something like this in some cases (not always):\[code\]aaaaaaaa1cccccccc3dddddddd4\[/code\]Can anyone tell me what am I missing here?Thanks,
 
Back
Top