• 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: XML-/HTML-safe formatted output from NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:@"&amp;"
options:NSLiteralSearch
range:NSMakeRange(0, [self
length])];
[_theString replaceOccurrencesOfString:@"<" withString:@"&lt;"
options:NSLiteralSearch
range:NSMakeRange(0, [self
length])];
[_theString replaceOccurrencesOfString:@">" withString:@"&gt;"
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.

References: 
 >Re: XML-/HTML-safe formatted output from NSString (From: Simon Stapleton <email@hidden>)

  • Prev by Date: Re: Syntax-coloring NSTextView
  • Next by Date: Re: EOF API?
  • Previous by thread: Re: XML-/HTML-safe formatted output from NSString
  • Next by thread: DO Connections
  • Index(es):
    • Date
    • Thread