I have 2 strings - dir1 and dir2, and I need to check if one is sub-directory for other. I tried to go with Contains method:
dir1.contains(dir2);
but that also returns true, if directories have similar names, for example - c:abc
and c:abc1
are not sub-directories, bet returns true. There must be a better way.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…