Return to Snippet

Revision: 45854
at May 9, 2011 22:00 by JoseKar


Initial Code
var myString:String = "<p><b>bold</b> <i>italic</i> <a href='#'>link</a> <br>linebreak</p>";
    trace(myString)
    var removeHtmlRegExp:RegExp = new RegExp("<[^<]+?>", "gi");
    myString = myString.replace(removeHtmlRegExp, "");
    trace(myString);
     
    // OUTPUT
    // <p><b>bold</b> <i>italic</i> <a href='#'>link</a> <br>linebreak</p>
    // bold italic link linebreak

Initial URL

                                

Initial Description

                                

Initial Title
Eliminar etiquetas HTML de un texto

Initial Tags
html

Initial Language
ActionScript 3