如何检查NSString是否为空 [英] how to Check NSString is null or not
本文介绍了如何检查NSString是否为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想检查天气 NSString
是否为空。我从JSON数组分配。分配该字符串后,值为< null>
。现在我想检查这个字符串是否为null。所以我像这样放了
I want to check weather a NSString
is null or not. Im assigning from an JSON array. After assigning that string value is <null>
. Now I want to check this string is null or not. So I put like this
if(myStringAuthID == nil)
但是这个if语句总是假的。我如何检查字符串是否为null。请帮帮我
if (myStringAuthID==nil)
but this if statement always false. How I can check a string for null. Please help me
谢谢
推荐答案
喜欢这样:
[myString isEqual: [NSNull null]];
这篇关于如何检查NSString是否为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文