How to tell java.lang.String.split to skip the delimiter?
<p>as input my program gets a String containing IP Addresses are separated by a line delimiter, i.e. one IP Address per line. To validate each of the addresses I do:</p>

<pre><code>String[] temp;
temp = address.split(System.getProperty("line.separator"));
</code></pre>

<p>and then I loop though the array of Strings.</p>

<p>I was wondering why all but the last IP Address were always invalid. I've found out, that they look like 10.1.1.1^M</p>

<p>Is there a way to tell the java.lang.String.split to drop the delimiter before putting the token into the array? Or what other options do I have here? Sorry, I'm not a Java Ninja, so I thought I'll ask you guys before I start googling for hours.</p>

<p>Thanks
Thomas</p>
