Created
February 13, 2015 11:35
-
-
Save youssman/49e761925a552de10887 to your computer and use it in GitHub Desktop.
Trim spaces from start/end of a NSString
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *string = @" this text has spaces before and after "; | |
NSString *trimmedString = [string stringByTrimmingCharactersInSet: | |
[NSCharacterSet whitespaceCharacterSet]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment