Pages

Saturday, June 25, 2011

Iphone:Trimming whitespace characters from NSString



If you need to trim whitespace characters at the start and end of a NSString, here’s an easy way:

existingStr = [ existingStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] ;

No comments:

Post a Comment