RE: HTML-encoded characters mucking up my NSStrings
RE: HTML-encoded characters mucking up my NSStrings
- Subject: RE: HTML-encoded characters mucking up my NSStrings
- From: email@hidden
- Date: Wed, 11 Feb 2004 08:41:52 -0800
Hi Josh:
There is a general purpose way to do string substitution using a
dictionary, NSString's componentsSeparatedByString and NSArray's
componentsJoinedByString.
I can send you the code if you like but the way it works is very
simple. You create a dictionary where each key is the escaped value
(e.g. "&") and whose value is the unescaped string (in this case "
").
You enumerate each key in the dictionary (using keyEnumerator on
NSDictionary). For each key in the enumeration call
componentSeparatedByString using the key. This gives you an array.
Using this array, you call componentsJoinedByString using the
valueForKey in your dictionary of the current key in your enumeration.
Hope this helps,
John
_______________________________________________
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.