public static bool IsTopLevel(string path) { if (String.IsNullOrEmpty(path)) return false; return PathSeparatorRegex.IsMatch(path) == false; }