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

AWS Lambda – Function in Go

Install DNF in RHEL/CentOS 7

AWS Lambda – Function in Java