У меня есть 2 строки - dir1 и dir2, и мне нужно проверить, является ли это подкаталогом для другого. Я попытался использовать метод Contains:
dir1.contains(dir2);
но это также возвращает true, если каталоги имеют похожие имена, например: c:\abc и c:\abc1 не являются подкаталогами, ставка возвращает true. Должен быть лучший способ.