コード例 #1
0
        public static string Remove(this string str, string strToRemove)
        {
            if (DoCheck.IsEmpty(str))
            {
                return("");
            }

            return(str.Replace(strToRemove, ""));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        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()));
        }