Friday, 30 September 2011

Checking white space and Trimming specific character in iphone

#define allTrim( anyobject ) [anyobject
 stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet] ]

NSString *stringname = @"   ";
if ( [allTrim( stringname ) length] == 0 ) NSLog(@"Is empty!");

No comments:

Post a Comment