Re: Stripping HTML tags
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.