// default in case there's no extension: String baseName = fileName; String extension = ""; // split on position of dot in name int lastDotPos = fileName.lastIndexOf("."); if(lastDotPos>=0 && fileName.length()>lastDotPos) { baseName = fileName.substring(0,lastDotPos); extension = fileName.substring(lastDotPos+1,fileName.length()); }
View All Comments
| View Tutorial