Carriage Return on iPhone

I am parsing an XML file with objective-c for Iphone. After parsing, the returned string variable received an input character. How to remove it from a string.

Thanks to everyone.

+4
source share
3 answers

I believe that the following snippet will take the desired picture.

NSString *foo = @"THis is foo\r"; NSString *bar = [foo stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; 
+19
source

You can also find the addition of NSString regular expressions . You can quickly replace the characters "\ r" with nothing to remove them from your document.

+1
source

The wiring above mentions using RegexKit on iphone.

In fact, you need to use RegexKitLite on the iPhone and associate it with an unsupported icu library.

RegexKit is not available for iPhone.

0
source

All Articles