2 Replies Latest reply: Aug 18, 2012 11:52 AM by Ned Murphy RSS

    How to string Replace use

    kiranemc2 Community Member

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

        • 1. Re: How to string Replace use
          Ned Murphy CommunityMVP

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

          • 2. Re: How to string Replace use
            Ned Murphy CommunityMVP

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