/// <summary> /// Determines if a path segment contains a specified directory separator. /// Detecting the use of a directory-separator by a path-segment requires an extra step beyond just determining if the path-segment contains the directory-separator. /// A path-segment can contain both Windows and non-Windows directory-separators, in which case the first directory-separator is the detected directory-separator because it is dominant. /// Validation is performed on the directory separator. /// </summary> public static bool ContainsDirectorySeparator(string pathSegment, string directorySeparator) { DirectorySeparatorGood.Validate(directorySeparator); var output = DirectorySeparatorGood.ContainsDirectorySeparatorUnchecked(pathSegment, directorySeparator); return(output); }
/// <summary> /// Determines if a path segment contains a Windows directory separator. /// </summary> public static bool ContainsNonWindowsDirectorySeparator(string pathSegment) { var output = DirectorySeparatorGood.ContainsDirectorySeparatorUnchecked(pathSegment, DirectorySeparatorGood.NonWindowsValue); return(output); }