prefix/dir1/dir2/dir3/dir4/..
How to parse the dir1, dir2 values out of the above string in Java?
dir1, dir2
The prefix here c
public class Test { public static void main(String args[]) { String s = "pre/fix/dir1/dir2/dir3/dir4/.."; String prefix = "pre/fix"; String[] tokens = s.substring(prefix.length()).split("/"); for (int i=0; i