Skip navigation
Currently Being Moderated

How to string Replace use

Aug 18, 2012 7:26 AM

var myString:String="<font face='arial'> <b>About Telcon</b></font>"

i need remove face tag "face='arial'".

finally i need below String is it possible.

 

"<font> <b>About Telcon</b></font>"

 
Replies
  • Currently Being Moderated
    Aug 18, 2012 9:59 AM   in reply to kiranemc2

    If you want to leave only the <font> tag, then you could use a regular expression to replace the whole <font...> tag, as in...

     

        var regexp:RegExp = /<font.*?>/;

     

        myString = myString.replace(regexp, "<font>");

     

    But if you want to specifically remove only the face portion of it, then you could use...

     

        var regexp:RegExp = / face.*'/;

     

        myString = myString.replace(regexp, "");

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 18, 2012 11:52 AM   in reply to Ned Murphy

    I was going to add that have a <font> tag that specifies nothing is about as good as not having one at all.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points