-7

I have a xml data, I want to replace the xml data with empty string

I want to replace with empty string, what is the regular expression to achieve this?

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
karansys
  • 2,449
  • 7
  • 40
  • 78
  • I am new to this regular expression, any suggestion would be helpful – karansys Feb 11 '20 at 12:49
  • you have to search for `` and `` and replace that with an empty string ; also calling `trim` will ensure there are no trailing spaces ; no need for regexp here (at least for the simple example you provided some minutes ago ; now the example is gone... not sure what you are up to) – Pierre Feb 11 '20 at 12:49
  • Have a look at https://stackoverflow.com/questions/60054698/extract-the-specific-substring-from-variable-value#comment106211328_60054698 – Reporter Feb 11 '20 at 12:51

1 Answers1

0
xmlString = xmlString.toString().replace(/<\/?xml>/gi,"").trim();
Twenty
  • 5,234
  • 4
  • 32
  • 67
karansys
  • 2,449
  • 7
  • 40
  • 78