Skip to content
Permalink
Browse files

Merge pull request #451 from OneGet/edyoung/allversions

StringComparison.CurrentCulture doesn't work as expected on linux with C locale
  • Loading branch information...
edyoung committed May 13, 2019
2 parents a1970f5 + bb628f8 commit 5e804a2a1f488867bcaf261ddd2f6d233b370f6a
@@ -342,14 +342,14 @@ public static bool EqualsIgnoreEndSlash(this string source, string input)
}

public static bool IsTrue(this string text) {
return !string.IsNullOrWhiteSpace(text) && text.Equals("true", StringComparison.CurrentCultureIgnoreCase);
return !string.IsNullOrWhiteSpace(text) && text.Equals("true", StringComparison.OrdinalIgnoreCase);
}

public static bool? IsTruePreserveNull(this string text) {
if (text == null) {
return null;
}
return !string.IsNullOrWhiteSpace(text) && text.Equals("true", StringComparison.CurrentCultureIgnoreCase);
return !string.IsNullOrWhiteSpace(text) && text.Equals("true", StringComparison.OrdinalIgnoreCase);
}

/// <summary>
@@ -192,7 +192,7 @@ public static bool EqualsIgnoreCase(this string str, string str2)

public static bool IsTrue(this string text)
{
return !string.IsNullOrWhiteSpace(text) && text.Equals("true", StringComparison.CurrentCultureIgnoreCase);
return !string.IsNullOrWhiteSpace(text) && text.Equals("true", StringComparison.OrdinalIgnoreCase);
}

public static bool CompareVersion(this string version1, string version2)

0 comments on commit 5e804a2

Please sign in to comment.
You can’t perform that action at this time.