var htmlStripper:TextField = new TextField();
htmlStripper.htmlText = originalHtmlString;
var strippedString:String = htmlStripper.text;
Sunday, March 16, 2008
Using TextField for HTML Stripping
This may be something commonly used already, but it's the first time I've run into the need. I am working on an application where I needed to strip all html tags out of a string. First over-complicating things, I looked around the net and found several functions that will parse out the html tags. Then it hit me, there's an easier way - and it's build right into Flash. Using the TextField class, you can easily rip the html tags out - and still keep your original string intact. Since TextField has both an htmlText property and a text property, you can write to one and read from the other:
Subscribe to:
Post Comments (Atom)
1 comments:
Hello I just entered before I have to leave to the airport, it's been very nice to meet you, if you want here is the site I told you about where I type some stuff and make good money (I work from home): here it is
Post a Comment