Here you can find the source of filename(final String path)
Parameter | Description |
---|---|
path | a parameter |
public static String filename(final String path)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .jav a 2 s. co m*/ * Return the filename part of a path. * * @param path * @return */ public static String filename(final String path) { int i = path.lastIndexOf('/'); return (i < 0) ? path : path.substring(i + 1); } }