Extract the extension of a file from a full pathname
URL: blog.paolomatrascia.com
Copy this code and paste it in your HTML
tmpFile.getName();
int whereDot = tmpFile.getName().lastIndexOf('.');
if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
return tmpFile.getName().substring(whereDot+1);
}
return "";
}
Report this snippet