• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to string Replace use

Community Beginner ,
Aug 18, 2012 Aug 18, 2012

Copy link to clipboard

Copied

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>"

TOPICS
ActionScript

Views

680

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2012 Aug 18, 2012

Copy link to clipboard

Copied

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, "");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2012 Aug 18, 2012

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines