判断字符串是否为null或空串

        // Check if it is empty string
        public static bool IsEmptyString(string str)
        {
            if (str == null)
            {
                return true;
            }

            if (str.Trim().Length == 0)
            {
                return true;
            }

            return false;
        }

posted @ 2011-04-12 16:14  梦幻星空  阅读(270)  评论(0)    收藏  举报