kanjinxiang

string str = string.Empty;
if (str == "")
{ }
else { }

if (str == string.Empty)
{ }
else { }

if (str.Length == 0)//效率最高
{ }
else { }

if (string.IsNullOrEmpty(str))//可读性更强
{ }
else { }

if (string.IsNullOrWhiteSpace(str))
{ }
else { }

 

 

----------------------------------------------------------------------------
创建于2017年2月24日

整理于2017年11月27日

分类:

技术点:

相关文章: