Javascript: Removing first text line if string starts with certain characters
<p>I wrote a script for some text manipulation, and want to add a function so that the first line of my input string is removed if it starts with the symbol '>'. I tried to find a solution for hours now, but I cannot get it to work: Somehow the first line is not removed properly.</p>

<p>My input text  should be processed as it is if it looks like this:
"<code>HABHHIKKLLMMNMNIL</code>"
and the first line should be removed if it looks like this:
"</p>

<pre><code>&gt;some text
HABHHIKKLLMMNMNIL
</code></pre>

<p>"</p>

<p>My current solution would look like this:</p>

<pre><code>// remove first line if starts with '&gt;'


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

sequence_str = sequence_str.replace(/(\r\n|\n|\r)/gm,""); //remove linebreaks
</code></pre>

<p>I would appreciate any ideas, and I hope some could help me to figure out where the problem is.</p>

<p>Thanks!</p>
