示例#1
0
        public static bool RemoveIgnoreCase(List <string> list, string value)
        {
            if (list == null)
            {
                return(false);
            }

            var item = list.FirstOrDefault(x => StringUtils.EqualsIgnoreCase(x, value));

            return(list.Remove(item));
        }
示例#2
0
 public static bool IsType(FileType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (StringUtils.EqualsIgnoreCase("." + type.GetValue(), typeStr))
     {
         return(true);
     }
     return(false);
 }
示例#3
0
 public static bool IsZip(string typeStr)
 {
     return(StringUtils.EqualsIgnoreCase(".zip", typeStr));
 }
示例#4
0
 public static bool ContainsIgnoreCase(IEnumerable <string> list, string target)
 {
     return(list != null && list.Any(element => StringUtils.EqualsIgnoreCase(element, target)));
 }
示例#5
0
        public static object GetValueIgnoreCase(IDictionary <string, object> dict, string key)
        {
            var item = dict?.FirstOrDefault(x => StringUtils.EqualsIgnoreCase(x.Key, key));

            return(item?.Value);
        }
示例#6
0
 public static bool IsTxt(string typeStr)
 {
     return(StringUtils.EqualsIgnoreCase(".txt", typeStr));
 }