diff --git a/src/NadekoBot/_Extensions/Extensions.cs b/src/NadekoBot/_Extensions/Extensions.cs index 8dbdf02b..f95e6fbb 100644 --- a/src/NadekoBot/_Extensions/Extensions.cs +++ b/src/NadekoBot/_Extensions/Extensions.cs @@ -278,6 +278,15 @@ namespace NadekoBot.Extensions return list; } } + + /// + /// Easy use of fast, efficient case-insensitive Contains check with StringComparison Member Types + /// CurrentCulture, CurrentCultureIgnoreCase, InvariantCulture, InvariantCultureIgnoreCase, Ordinal, OrdinalIgnoreCase + /// + public static bool ContainsNoCase(this string str, string contains, StringComparison compare) + { + return str.IndexOf(contains, compare) >= 0; + } public static string TrimTo(this string str, int maxLength, bool hideDots = false) { @@ -436,4 +445,4 @@ namespace NadekoBot.Extensions : usr.AvatarUrl; } } -} \ No newline at end of file +}