-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,094
  • 11
  • 98
  • 153
Mag
  • 267
  • 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,094
  • 11
  • 98
  • 153