Looking for a way to check if an string contains in another ignoring upper/lower case, I found it:
Works fine. Then, I tried put it to my StringExtensions
namespace.
namespace StringExtensions
{
public static class StringExtensionsClass
{
//...
public static bool Contains(this string target, string toCheck, StringComparison comp)
{
return target.IndexOf(toCheck, comp) >= 0;
}
}
}
and then:
using StringExtensions;
...
if (".. a".Contains("A", StringComparison.OrdinalIgnoreCase))
but I get the following error:
No overload for method 'Contains' takes '2' arguments
How do I fix it?