mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-03 13:34:54 +00:00
Add EndsWithIgnoreCase and ContainsIgnoreCase
This commit is contained in:
parent
cbb1ed2b16
commit
d5ac008747
1 changed files with 10 additions and 0 deletions
|
@ -114,6 +114,11 @@ public static bool StartsWithIgnoreCase(this string text, string startsWith)
|
|||
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 @@ public static string SplitCamelCase(this string input)
|
|||
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 a new issue