I have an NSMutableString* (theBigString) that contains text loaded from an online file. I am writing theBigString to a local file on the iPad and then emailing it as an attachment.
[theBigString appendString:[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]];
Despite my best efforts using the following lines of code, when I open the email attachment there still exists multiple lines of text instead of one long line of text which is what I expected (and need for my app to work).
[theBigString stringByReplacingOccurrencesOfString:@"\\s+" withString:@" "];
[theBigString stringByReplacingOccurrencesOfString:@"\n" withString:@" "];
[theBigString stringByReplacingOccurrencesOfString:@"\r" withString:@" "];
[theBigString stringByReplacingOccurrencesOfString:@"\r\n" withString:@" "];
If I open the text file and view the formatting it still shows a couple of new paragraph symbols.
Is there another newline type character besides "\n" or "\r" that I am not stripping with the above code?