Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I trim " " and "\n" in NSMutableString

How do I trim " " and "\n" in NSMutableString?

like image 633
marcy Avatar asked Dec 14 '22 01:12

marcy


1 Answers

NSCharacterSet* charsToTrim = [NSCharacterSet characterSetWithCharactersInString:@" \n"];
NSString* trimmedStr = [aStr stringByTrimmingCharactersInSet:charsToTrim];
like image 89
Tom Dalling Avatar answered Dec 29 '22 09:12

Tom Dalling