方法1:str==""


方法2:str==string.Empty


方法3:str.Length==0


方法4:string.IsNullOrEmpty(str)

 

 

方法3效率最高,原因数字的比较速度最快!!!


 

Reflector查看源码结果:
空字符串的判断

 

 

 

相关文章:

  • 2021-09-04
  • 2021-12-04
  • 2022-12-23
  • 2021-12-04
  • 2021-09-13
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2021-12-01
  • 2021-12-04
  • 2021-12-04
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案