String directoryName(const String& path)
{
    String name = path.left(path.length() - pathGetFileName(path).length());
    if (name.characterStartingAt(name.length() - 1) == '\\') {
        name.truncate(name.length() - 1);
    }
    return name;
}

Unknown