Re: XML-/HTML-safe formatted output from NSString
Re: XML-/HTML-safe formatted output from NSString
- Subject: Re: XML-/HTML-safe formatted output from NSString
- From: Scott Anguish <email@hidden>
- Date: Wed, 30 Oct 2002 16:19:45 -0500
Ga! You're definitely right! Thanks.. will fix on my side.
On Wednesday, October 30, 2002, at 02:51 PM, Simon Stapleton wrote:
Scott. I think you meant [_theString length] rather than [self
length] in the NSMakeRange calls.
Otherwise, it's fine.
Simon
From: Scott Anguish <email@hidden>
- (NSString *)stringByEncodingXMLCharacters
{
NSMutableString *_theString=[self mutableCopy];
[_theString replaceOccurrencesOfString:@"&" withString:@"&"
options:NSLiteralSearch
range:NSMakeRange(0, [self
length])];
[_theString replaceOccurrencesOfString:@"<" withString:@"<"
options:NSLiteralSearch
range:NSMakeRange(0, [self
length])];
[_theString replaceOccurrencesOfString:@">" withString:@">"
options:NSLiteralSearch
range:NSMakeRange(0, [self
length])];
NSString *_nonMutableVersion=[NSString
stringWithString:_theString];
[_theString release];
return _nonMutableVersion;
}
@end
--
PGP Key Id : 0x50D0698D
--
Well, we finally have an indoor toilet. But what new disasters have
struck the Alpenproject?
Find out at : <http://www.tufty.co.uk/Move/index.html>
_______________________________________________
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.