Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

remove a file extension from a string

807589Jul 19 2006 — edited Jul 22 2008
When I open a file I am retrieving the file name using the JFileChooser getName method. This returns the file name with the extension e.g. filename.txt. I would like to print this file name to the screen with out the extension. Is there a method call to revome the extension, or is it necessary to loop through the string until the dot is reached and then discard the rest?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2008
Added on Jul 19 2006
9 comments
1,025 views