Posted By

yuanyou on 10/25/09


Tagged


Versions (?)

getFileName


 / Published in: ColdFusion
 

  1. private String getFileName(String path)
  2. {
  3.  
  4. String filename = path;
  5. int pos = filename.lastIndexOf("\\");
  6. if (pos > 0) {
  7. filename = filename.substring(pos + 1);
  8. }
  9. pos = filename.lastIndexOf("/");
  10. if (pos > 0) {
  11. filename = filename.substring(pos + 1);
  12. }
  13. return filename;
  14. }

Report this snippet  

You need to login to post a comment.