Java File Name Extract extractFilename(String path)

Here you can find the source of extractFilename(String path)

Description

extract Filename

License

Open Source License

Declaration

public static String extractFilename(String path) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU Lesser General Public License as published by

public class Main {
    public static String extractFilename(String path) {
        if (path == null)
            return null;
        String norm = path.replace('\\', '/');
        int i = norm.lastIndexOf('/');
        if (i == -1) {
            return path;
        } else {//from w  ww .  j  a  va2s .  co  m
            return norm.substring(i + 1);
        }
    }
}

Related

  1. extractFileName(String filePathName)
  2. extractFileName(String filePathName)
  3. extractFileName(String fn)
  4. extractFileName(String fullPath)
  5. extractFileName(String name)
  6. extractFileName(String path)
  7. extractFileName(String path)
  8. extractFileName(String path)
  9. extractFilename(String path)