I am having an NSString object as "HAI HELLO ABC".I want it to "HAIHELLOABC".Is there any function present?
Asked
Active
Viewed 1,185 times
-4
-
4possible duplicate of [How to remove whitespace in a string?](http://stackoverflow.com/questions/6608420/how-to-remove-whitespace-in-a-string) – Bhumeshwer katre Dec 04 '13 at 09:09
-
1You can also use stringByTrimmingCharactersInSet: see the example below. Ex: NSString *string = @"HAI ABC HELLO"; string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; – Zac24 Dec 04 '13 at 11:36