• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: replacing control characters in a NSMutableString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >replacing control characters in a NSMutableString (From: email@hidden)

  • Prev by Date: Re: stringWithFormat: problem
  • Next by Date: Re: Can't create NSBitmapImageRep for CMYK planar data?
  • Previous by thread: replacing control characters in a NSMutableString
  • Next by thread: problem with [NSData bytes] on Intel
  • Index(es):
    • Date
    • Thread