Posted By

saturngod on 10/22/10


Tagged

iPhoneSDK


Versions (?)

Remove Whitespace in iPhone SDK


 / Published in: Objective C
 

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

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

Report this snippet  

You need to login to post a comment.