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: Simon Stapleton <email@hidden>
- Date: Wed, 30 Oct 2002 20:51:19 +0100
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.