美文网首页
判断字符串是否为空串

判断字符串是否为空串

作者: 如果思念是自己的 | 来源:发表于2018-02-23 11:45 被阅读12次

    一般常用于服务器返回的数据,判断该字段是否为空串,而后进行剩余操作。

    宏定义的,方便使用

    #define isEmptyString(s)  (((s) == nil) || ([(s) stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length == 0))
    

    相关文章

      网友评论

          本文标题:判断字符串是否为空串

          本文链接:https://www.haomeiwen.com/subject/setxxftx.html