Java File Base Name Get basename(String path)

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

Description

basename

License

Apache License

Declaration

static String basename(String path) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    static final char PATH_SEP = '/';

    static String basename(String path) {
        return path.substring(path.lastIndexOf(PATH_SEP) + 1);
    }/*from ww w .  j  av  a 2  s .com*/
}

Related

  1. baseName(String name)
  2. basename(String name, String split)
  3. basename(String path)
  4. basename(String path)
  5. basename(String path)
  6. baseName(String path)
  7. basename(String path)
  8. basename(String path, char separator)
  9. basename(String s)