We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 934c024 commit bc4e251Copy full SHA for bc4e251
1 file changed
src/main/java/jce/util/PathHelper.java
@@ -40,6 +40,18 @@ public String append(String... paths) {
40
}
41
42
43
+ /**
44
+ * Cuts the first parent from a path.
45
+ * @param path is the path.
46
+ * @return the cut path, or the original if it has no parents.
47
+ */
48
+ public String cutParent(String path) {
49
+ if (path.contains(Character.toString(separator))) {
50
+ return path.substring(path.indexOf(separator) + 1);
51
+ }
52
+ return path;
53
54
+
55
/**
56
* Returns the name of the original path. That is the last segment of the original path.
57
* @param path is the original path.
0 commit comments