Removing whitespace from NSString


/ Published in: Objective C
Save to your folder(s)

removing whitespace from front and end of a string


Copy this code and paste it in your HTML
  1. NSString *string = @" spaces in front and at the end ";
  2. NSString *trimmedString = [string stringByTrimmingCharactersInSet:
  3. [NSCharacterSet whitespaceAndNewlineCharacterSet]];
  4. NSLog(trimmedString)

URL: http://www.cocoanetics.com/2009/01/remove-whitespace-from-nsstring/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.