public static string Remove(this string str, string strToRemove) { if (DoCheck.IsEmpty(str)) { return(""); } return(str.Replace(strToRemove, "")); }
public static bool IsIn <T>(this T source, IEnumerable <T> list) { if (null == source) { throw new ArgumentNullException(nameof(source)); } if (DoCheck.IsEmpty(list)) { throw new ArgumentNullException(nameof(list)); } return(list.Contains(source)); }
public static string FullTrim(this string str, params char[] trimChars) { if (DoCheck.IsEmpty(str)) { return(string.Empty); } var list = new List <char>(); list.AddRange(trimList); if (trimChars.Length > 0) { foreach (var item in trimChars) { list.Add(item); } } return(str.Trim(list.ToArray())); }