stringByTrimmingCharactersInSet (revisited)
stringByTrimmingCharactersInSet (revisited)
- Subject: stringByTrimmingCharactersInSet (revisited)
- From: "Brad Peterson" <email@hidden>
- Date: Sat, 23 Aug 2003 11:16:26 +0000
Hi all,
I know there have been a number of posts over the years about this subject,
but I've run into an interesting new twist (at least, I didn't see it in the
archives) that I thought I'd share/open for comments...
I've got a string (ip address) which may (or may not) arrive in my app
quoted. (That is, "102.111.34.4" where the quote marks are actually part of
the string data I'll receive.)
So that I can use the ip address elsewhere, I wanted to do a
stringByTrimmingCharactersInSet always without needing to test for the
presence of the quotes.
However, the compiler won't let me use the escaped quote (\") as below:
ip = [ip stringByTrimmingCharactersInSet:[NSCharacterSet
characterSetWithCharactersInString:@"\""]];
Any thoughts? I'm open to suggestions on either how to rewrite this line or
achieve the same results other ways...
Brad
_________________________________________________________________
Get MSN 8 and help protect your children with advanced parental controls.
http://join.msn.com/?page=features/parental
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.