Add EndsWithIgnoreCase and ContainsIgnoreCase

pull/4264/head
Bogdan 7 months ago
parent cbb1ed2b16
commit d5ac008747

@ -114,6 +114,11 @@ namespace NzbDrone.Common.Extensions
return text.StartsWith(startsWith, StringComparison.InvariantCultureIgnoreCase);
}
public static bool EndsWithIgnoreCase(this string text, string startsWith)
{
return text.EndsWith(startsWith, StringComparison.InvariantCultureIgnoreCase);
}
public static bool EqualsIgnoreCase(this string text, string equals)
{
return text.Equals(equals, StringComparison.InvariantCultureIgnoreCase);
@ -164,6 +169,11 @@ namespace NzbDrone.Common.Extensions
return CamelCaseRegex.Replace(input, match => " " + match.Value);
}
public static bool ContainsIgnoreCase(this IEnumerable<string> source, string value)
{
return source.Contains(value, StringComparer.InvariantCultureIgnoreCase);
}
public static double FuzzyMatch(this string a, string b)
{
if (a.IsNullOrWhiteSpace() || b.IsNullOrWhiteSpace())

Loading…
Cancel
Save