Friday, 11 March 2011

how to remove white spaces from a string in objective C


A one line solution:

NSString *whitespaceString = @" String with whitespaces ";

NSString *trimmedString = [whitespaceString stringByReplacingOccurrencesOfString:@" " withString:@""];

No comments:

Post a Comment