Possible Duplicate:
Replacing one character in a string in Objective-C
Remove all whitespace from NSString
@"this string contains blank spaces"
.
How can we convert this string into @"thisstringcontainsblankspaces"
.
I mean how can we trim all the blank spaces and new line charecters in a string. I have already tried NSCharecterSet
by using whitespaceCharacterSet
. But this only removes the spaces at the ends of the string and not in between....
Any ideas??