public static bool PathEquals(this string firstPath, string secondPath) { if (OsInfo.IsLinux) { return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath()); } return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), StringComparison.InvariantCultureIgnoreCase); }
public static bool PathEquals(this string firstPath, string secondPath) { if (OsInfo.IsMono) { if (firstPath.Equals(secondPath)) return true; return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath()); } if (firstPath.Equals(secondPath, StringComparison.OrdinalIgnoreCase)) return true; return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), StringComparison.OrdinalIgnoreCase); }
public static bool PathEquals(this string firstPath, string secondPath, StringComparison? comparison = null) { if (!comparison.HasValue) { comparison = OsInfo.PathStringComparison; } if (firstPath.Equals(secondPath, comparison.Value)) return true; return string.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), comparison.Value); }
public static bool PathEquals(this string firstPath, string secondPath) { if (firstPath.Equals(secondPath, OsInfo.PathStringComparison)) return true; return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), OsInfo.PathStringComparison); }