2 Replies Latest reply: Jun 14, 2008 4:19 AM by 800282 RSS

    How can I match the period (.) with String.split()?

      I would like to split the parts of a file name up according to the period that separates the file name and file type. I was hoping I could do this:
      String[] fileNameParts = fileName.split(".");
      However I have come to learn that the period(.) is not a regular expression and does not produce the results I was expecting. Is there a way I can force the period(.) to be treated as a regular expression? Thanks.