/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Trim the file path from the given file name. Anything before the last occurred "/" and "\" will be * trimmed, including the slash. * * @param fileName * The file name to trim the file path from. * @return The file name with the file path trimmed. */ return fileName.substring(fileName.lastIndexOf("/") + 1).substring(fileName.lastIndexOf("\\") + 1); }