• 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: Stripping HTML tags
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stripping HTML tags


  • Subject: Re: Stripping HTML tags
  • From: sinclair44 <email@hidden>
  • Date: Fri, 14 Mar 2003 15:42:08 -0500

On 3/13/03 10:21 PM, "Jeffrey Mattox" <email@hidden> wrote:

> I sure would like to see more about this (I don't understand the
> attributes). Could you post the actual snippet that did the trick?
>
> Thanks
>
> Jeff

Sure. Attributes can be nil; all it's needed for is passing back the
formatting information (which in this case can be discarded).

NSString *message = [anObject getHTMLFormattedMessage];

NSData *messageData = [message dataUsingEncoding:[NSString
defaultCStringEncoding]];

NSAttributedString *messageAttrbString = [[[NSAttributedString alloc]
initWithHTML:messageData documentAttributes:nil] autorelease];

NSString *noHTMLMessage = [messageAttrbString string];

In this code, message gets stripped of its HTML and put into noHTMLMessage.
I've used many more variables than are actually needed, but it still gets
the point across.
--

-- sinclair44

[self becomeWorldDictator];

- (void)becomeWorldDictator
{
[self coverLegalButt];

[[GeorgeBush principalClass] assassinate:[world currentLeaders]];
[[BinLaden principalClass] terrorize:[world citizens]];
[world setCurrentLeaders:[NSArray arrayWithObject:self]];
}

- (void)coverLegalButt
{
/* The above does not reflect any plans, expressed or implied, real or
imaginative, to kill or assassinate anyone, or to harm anyone in any shape,
way or form. Any relation to actual events is purely coincidental. */
}
_______________________________________________
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: Stripping HTML tags (From: Jeffrey Mattox <email@hidden>)

  • Prev by Date: Re: NSObject performSelectorOnMainThread:
  • Next by Date: Re[2]: NSAppleEventManager details ??
  • Previous by thread: Re: Stripping HTML tags
  • Next by thread: Hotkey linker problem
  • Index(es):
    • Date
    • Thread