IOS How to trim all leading whitespace from NSString

NSString *myText = @"       hello foo    ";    
NSString *trimmedText = [myText stringByTrimmingCharactersInSet:
                          [NSCharacterSet whitespaceCharacterSet]];
NSLog(@"old = [%@], trimmed = [%@]", myText, trimmedText);

Comments

Popular posts from this blog

LINUX Move and copy files using SSH

PHP Predefined Variables

Java : Variables Declaring