Results 1 to 3 of 3
Thread: Problem splitting a string
- 03-13-2011, 09:43 PM #1
Problem splitting a string
I am trying to split up a filename into parts:
String filename = file.getName(); System.out.println("File: "+filename); String parts = filename.split("."); System.out.println(parts);
Then I get an indexoutOfBounds exception when trying to print out parts.
I even went so far as to iterate over each character in the filename string and keep a count of the "." instances, and it gives me back a 1 so I know it recognizes the period...not sure whats going on.
Last edited by sehudson; 03-13-2011 at 09:47 PM.
- 03-13-2011, 09:56 PM #3
- By Gokul138 in forum New To JavaReplies: 1Last Post: 02-07-2011, 09:22 PM
- By fmuddy in forum Advanced JavaReplies: 3Last Post: 03-03-2010, 01:23 AM
- By A.M.S in forum New To JavaReplies: 1Last Post: 12-04-2009, 08:17 AM
- By phil128 in forum New To JavaReplies: 11Last Post: 01-12-2009, 12:51 PM
- By itsme in forum New To JavaReplies: 1Last Post: 12-11-2007, 04:08 PM