Search a string for newlines within a string just containing "\n"
<p>I have a really annoying issue that I can't fix :(</p>

<pre><code>private static final String NEW_LINE = System.getProperty("line.separator");
text = "\n";
int count = text.split(NEW_LINE).length;
</code></pre>

<p><code>count</code> keeps returning 0 when it should return 1
I think its because <code>\n</code> isnt actually a string but a newline.</p>

<p>Is there a way to fix this?</p>
