Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
NSString empty checks
@interface NSString (FSQFoundation)
+ (BOOL) isEmpty:(NSString *)string;
+ (BOOL) isNotEmpty:(NSString *)string;
@implementation NSString (FSQFoundation)
+ (BOOL) isEmpty:(NSString *)string {
return string == nil || [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length < 1;
+ (BOOL) isNotEmpty:(NSString *)string {
return NO == [self isEmpty:string];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.