title: Splitting filenames using system file separator symbol
body: <p>I have a complete file path and I want to get the file name.</p>
  
  <p>I am using the following instruction:</p>
  
  <pre><code>String[] splittedFileName = fileName.split(System.getProperty("file.separator"));
  String simpleFileName = splittedFileName[splittedFileName.length-1];
  </code></pre>
  
  <p>But on Windows it gives:</p>
  
  <pre><code>java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
  \
   ^
  </code></pre>
  
  <p>Can I avoid this exception? Is there a better way to do this?</p>