FAQ
overflow

Great Answers to
Questions About Everything

QUESTION

How do I test if an NSString is empty in Objective C?

{ asked by Jamey McElveen }

ANSWER

You can check if [string length] == 0. This will check if it's a valid but empty string (@"") as well as if its nil, since calling length on nil will also return 0.

{ answered by Marc Charbonneau }
Tweet