Skip to content

Instantly share code, notes, and snippets.

@barik
Created May 13, 2015 14:56
Show Gist options
  • Save barik/fcfde98639d9361bdf5b to your computer and use it in GitHub Desktop.
Save barik/fcfde98639d9361bdf5b to your computer and use it in GitHub Desktop.
private static boolean isParentOf(char[] folderName, char[] fileName) {
if (folderName.length >= fileName.length) {
return false;
}
if (fileName[folderName.length] != '\\' && fileName[folderName.length] != '/') {
return false;
}
for (int i = folderName.length - 1; i >= 0; i--) {
if (folderName[i] != fileName[i]) {
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment