public static String getLastPathComponent ( String path ) { // find last '.' character int pos = path . lastIndexOf ( ' ' ) ; // return the last path component // or the complete path, if no '.' chars were found return pos >= 0 ? path . substring ( pos + 1 ) : path ; }
Returns the last component of a dot - separated path .