为已有的类 string 扩展方法

来源:互联网 发布:java前端要学什么 编辑:程序博客网 时间:2024/06/05 19:15
 public static bool IsNullOrEmpty(this string str)
        {
            if (str == string.Empty || str == null)
                return true;
            else return false;
        }
        public static bool IsNotNullAndEmpty(this string str)
        {
            if (str != string.Empty && str != null)
                return true;
            else return false;
        }
0 0
原创粉丝点击