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

原文地址:https://www.cnblogs.com/godwar/p/1292480.html