Checking empty string
NSString *string1=@"";
NSString *string2=@" ";
NSString *string3=@" \n ";
NSString *string1=@"";
NSString *string2=@" ";
NSString *string3=@" \n ";
string1 is an empty string.
string2 is not empty having empty whitespace
[[string2 stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
string3 is not empty having empty whitespace and new line character
[string3 stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
all the above string can be checked with @"" to test empty string.