-1

I am trying to replace all substrings which start with the & character and end with ;. For example "

Will be great if somebody can suggest me how to convert all unicodes.

Xavi López
  • 27,550
  • 11
  • 97
  • 161
Mag
  • 297
  • 1
  • 5
  • 19

1 Answers1

2

Instance a RegExp object with &.*?; expression and the g flag then use it to perform replacement with an empty string

""Some"".replace(new RegExp("&.*?;", "g"), "");
Xavi López
  • 27,550
  • 11
  • 97
  • 161