Re: replacing control characters in a NSMutableString
Re: replacing control characters in a NSMutableString
- Subject: Re: replacing control characters in a NSMutableString
- From: David Kennedy <email@hidden>
- Date: Sat, 4 Feb 2006 10:16:02 +0000
On 4 Feb 2006, at 04:01, email@hidden wrote:
Is there any way to take my NSString/NSMutableString - which has
the \-escaped sequences in it such as \n, \\, \", etc. and replace
those with the appropriate values?
I've used this to replace the \n and \r escape sequence...
[myMutableString replaceOccurrencesOfString:@"\\n" withString:@"\n"
options:0 range:NSMakeRange(0, [myMutableString length])];
[myMutableString replaceOccurrencesOfString:@"\\r" withString:@"\r"
options:0 range:NSMakeRange(0, [myMutableString length])];
There may be a better way at doing a whole set escape sequences in
one go though?
Cheers,
Dave
------
David Kennedy (http://www.zenopolis.com)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden