String.IsNullOrEmpty 方法

方法:
public static bool IsNullOrEmpty(string value)
{
   if (value != null)
   {
       return (value.Length == 0);
   }
   return true;
}

如果 string.IsNullOrEmpty("  ") 其实返回为 false.


例:
string AA=" ";

string.IsNullOrEmpty(A) =false

string.IsNullOrEmpty(Trim(A)) =true

posted on 2008-09-17 13:30  巍巍边疆  阅读(2009)  评论(1编辑  收藏  举报