首页 > 其他 > 详细

随笔——string.IsNullOrEmpty和string.IsNullOrWhiteSpace的区别

时间:2017-02-17 22:10:45      阅读:151      评论:0      收藏:0      [点我收藏+]

string.IsNullOrEmpty大家应该都很熟悉,那么string.IsNullOrWhiteSpace就比string.IsNullOrEmpty多了一个判断的的内容,区别如下表:


string.IsNullOrEmpty

string.IsNullOrWhiteSpace
1null1null
2string.Empty2string.Empty
3""3""


4" "

string.IsNullOrWhiteSpace就是可以判断" "里面仍然是空的字符串。

在工作中会更经常使用到string.IsNullOrWhiteSpace

学无止境,随手记记。

本文出自 “zhencoolgirl” 博客,请务必保留此出处http://zhencoolgirl.blog.51cto.com/12451952/1898835

随笔——string.IsNullOrEmpty和string.IsNullOrWhiteSpace的区别

原文:http://zhencoolgirl.blog.51cto.com/12451952/1898835

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!