Java string split with "." (dot)
<p>Why second line of this code in Java throws ArrayIndexOutOfBoundsException?</p>

<pre><code>String filename = "D:/some folder/001.docx";
String extensionRemoved = filename.split(".")[0];
</code></pre>

<p>While below works:</p>

<pre><code>String driveLetter = filename.split("/")[0];
</code></pre>

<p>I use Java 7.</p>
