namespace SimplCommerce.Infrastructure.Helpers
{
public static class StringHelper
{
public static bool Contains(this String str,
String substr,
StringComparison cmp)
{
if (substr == null)
throw new ArgumentNullException("substring substring",
" cannot be null.");
else if (!Enum.IsDefined(typeof(StringComparison), cmp))
throw new ArgumentException("comp is not a member of",
"StringComparison, comp");
return str.ToUpper().IndexOf(substr.ToUpper(), cmp) >= 0;
}
}
}
Yorumlar
Yorum Gönder