Posted By

JoseKar on 05/09/11


Tagged

html tag


Versions (?)

Eliminar etiquetas HTML de un texto


 / Published in: ActionScript 3
 

  1. var myString:String = "<p><b>bold</b> <i>italic</i> <a href='#'>link</a> <br>linebreak</p>";
  2. trace(myString)
  3. var removeHtmlRegExp:RegExp = new RegExp("<[^<]+?>", "gi");
  4. myString = myString.replace(removeHtmlRegExp, "");
  5. trace(myString);
  6.  
  7. // OUTPUT
  8. // <p><b>bold</b> <i>italic</i> <a href='#'>link</a> <br>linebreak</p>
  9. // bold italic link linebreak

Report this snippet  

You need to login to post a comment.