Delete a line of text in javascript

The cleanest way of doing this is to use the split and join functions, which will let you manipulate the text block as an array of lines, like so:

// break the textblock into an array of lines
var lines = textblock.split('\n');
// remove one line, starting at the first position
lines.splice(0,1);
// join the array back into a single string
var newtext = lines.join('\n');

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)