QString isEmpty isNull
2016-07-28 13:41
489 查看
bool QString::isEmpty () const
如果字符串为空,也就是如果length() == 0,返回真。因此,零字符串也是空字符串。QString a( "" ); a.isEmpty(); // 真 a.isNull(); // 假 QString b; b.isEmpty(); // 真 b.isNull(); // 真
也可以参考isNull()和length()。
实例:addressbook/mainwindow.cpp、chart/chartform.cpp、chart/chartform_canvas.cpp、network/networkprotocol/nntp.cpp、qmag/qmag.cpp和qwerty/qwerty.cpp。
bool QString::isNull () const
如果字符串为零,返回真。零字符串总是空的。QString a; // a.unicode() == 0,a.length() == 0 a.isNull(); // 真,因为a.unicode() == 0 a.isEmpty(); // 真
也可以参考isEmpty()和length()。
实例:i18n/main.cpp和qdir/qdir.cpp。
转自:http://www.kuqin.com/qtdocument/qstring.html
相关文章推荐
- 解决Toast快速点击,重复多次的问题
- 香烟过滤嘴模型
- test
- iOS开发富文本NSAttributedString属性
- linux基本命令之用户登录查看命令
- 图像算法研究---一种简单的YUV转RGB的优化算法
- android 蛋糕图
- mongodb之sharding搭建
- @Html.Raw显示一张图片
- 关于centos7的网卡命名
- LeetCOde 64. Minimum Path Sum
- 使用 ssi 服务器端包含文件
- ios 后台无限心跳实现:GCDAsyncSocket使用的 Voip、NSTimer、10分钟超长链接
- C/C++运维中发现的两个隐晦BUG
- StringBuffer和StringBuilder
- poj 1860 Currency Exchange
- 剑指offer——连续子数组的最大和
- 功能强大的HTML5上传组件-Web Uploader
- 重温数据结构(一)
- ios developer tiny share-20160728