IOS: verify if a string is an empty string
ios, nsstring
Solution
You can use this test:
if ([[myString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] == 0) {
// The string is empty
}
Problem
is there a method to verify if a NSString haven't characters? example of string without characters can be: @"" or @" " or @"\n " or @"\n\n ", I want cosider these strings as empty strings and print a nslog that say me that these are emty, what kind of control I should use?