Java Utililty Methods Path Tail

List of utility methods to do Path Tail

  1. HOME
  2. Java
  3. P
  4. Path Tail

Description

The list of methods to do Path Tail are organized into topic(s).

Method

String tail(String path)
tail
int index = path.length() - 1;
if (index >= 0 && index < path.length() && path.charAt(index) == '/') {
 index--;
for (int i = index; i >= 0; i--) {
 if (path.charAt(i) == '/') {
 return path.substring(i + 1, index + 1);
return path;
String tail(String path)
tail
int sepIdx = path.indexOf(SEP);
if (sepIdx == -1) {
 return "";
return path.substring(sepIdx + 1);
String tail(String path)
tail
path = removeTrailingSlash(path);
int index = path.lastIndexOf('/');
if (index >= 0) {
 return path.substring(index + 1);
return path;

AltStyle によって変換されたページ (->オリジナル) /