mirror of https://github.com/lidarr/Lidarr
Add EndsWithIgnoreCase and ContainsIgnoreCase
This commit is contained in:
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…
Reference in New Issue