zoukankan      html  css  js  c++  java
  • IsNullOrEmpty与IsNullOrWhiteSpace区别

    IsNullOrEmpty

        public static bool IsNullOrEmpty(String value) {
            return (value == null || value.Length == 0);
        }
    
    IsNullOrWhiteSpace
    
        public static bool IsNullOrWhiteSpace(String value) {
            if (value == null) return true;
    
            for(int i = 0; i < value.Length; i++) {
                if(!Char.IsWhiteSpace(value[i])) return false;
            }
    
            return true;
        }
    

    --EOF--

    No.304

    写于 2014-10-22

  • 相关阅读:
    iOS
    iOS
    ios
    iOS
    ios
    ios
    iOS
    ios
    常用NSString的方法
    instancetype
  • 原文地址:https://www.cnblogs.com/hduwbf/p/6201972.html
Copyright © 2011-2022 走看看