add tail() to Utilities

This commit is contained in:
Grahame Grieve 2023-03-13 13:53:41 +11:00
parent 46ed0157ce
commit a45de03431
1 changed files with 14 additions and 0 deletions

View File

@ -1980,6 +1980,20 @@ public class Utilities {
}
}
public static String tail(String url) {
int i = url.length()-1;
while (i >= 0 && isTokenChar(url.charAt(i))) {
i--;
}
if (i < 0) {
return url;
} else {
return url.substring(i+1);
}
}
//public static boolean !isWhitespace(String s) {
//boolean ok = true;
//for (int i = 0; i < s.length(); i++)