How should I remove all the empty lines from a string
<p>I get a string value from an api, and there's a lot of useless empty lines:</p>

<pre><code>bla bla bla


bla

bla bla bla
</code></pre>

<p>I want to remove those empty lines to get this result:</p>

<pre><code>bla bla bla
bla
bla bla bla
</code></pre>

<p>How can I proceed ?</p>