How do I get file extension in Java without using that silly lastIndexOf('.') etc.?
How do I get file extension in Java without using that silly lastIndexOf('.') etc.?
Do not want to include external libraries? Use regular expressions:
String extension = filename.replaceAll("^.*\\.([^.]+)$", "$1");