逛奔的蜗牛

我不聪明,但我会很努力

   ::  :: 新随笔 ::  ::  :: 管理 ::
bool QString::isEmpty () const

Returns true if the string has no characters; otherwise returns false.

Example:

     QString().isEmpty();            // returns true
     QString("").isEmpty();          // returns true
     QString("x").isEmpty();         // returns false
     QString("abc").isEmpty();       // returns false
See also size().

bool QString::isNull () const

Returns true if this string is null; otherwise returns false.

Example:

     QString().isNull();             // returns true
     QString("").isNull();           // returns false
     QString("abc").isNull();        // returns false
Qt makes a distinction between null strings and empty strings for historical reasons. For most applications, what matters is whether or not a string contains any data, and this can be determined using the isEmpty() function.
posted on 2009-05-02 13:41 逛奔的蜗牛 阅读(3652) 评论(0)  编辑 收藏 引用 所属分类: Qt

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理