-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
  • 561,645
  • 34
  • 376
  • 476
karansys
  • 2,069
  • 1
  • 24
  • 59
  • 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
  • 4,232
  • 3
  • 24
  • 56
karansys
  • 2,069
  • 1
  • 24
  • 59