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

Java : Variables Declaring

SQL Self JOIN