Case insensitive StringHelper.EnsureEndsWith

I’ve created an extension  method for string 
     
public static string EnsureEndsWith(this string str,string sEndValue,bool ignoreCase=true)
        {
            if (!str.EndsWith(sEndValue, ignoreCase, CultureInfo.InvariantCulture))
            {
                str = str + sEndValue;
            }
            return str;
        }
Advertisements