string m_str = "";//长度0,非空

        判断一个字串是否为空字串(即String.Empty或"")的时候,

if (s!=null && s.Length==0) …

因此,当判断System.String两种可能返回值(空引用或空字串)的时候

if (s==null || s.Length==0)
{
// 处理空引用或空字串情况
}
else
{
// 处理有值字串情况
}

--------------

另:String.Empty用法

if (m_str!= null)
{
   return myBinding.Expression;
}
return String.Empty

posted on 2009-03-10 17:01  秋波渡  阅读(298)  评论(0编辑  收藏  举报