-1

I have used the replaceAll method of Javascript to replace the occurrences of character code " to Double Quotes in a big comma separated String. I really worry whether it will cause any issues or performance issues when deal with large amount of data.

Data will be like below:-

"TEST,TEST,"TEST",TEST,
TEST,TEST,TEST,TEST,
"TEST",TEST,TEST,TEST,
.
.
.Many Rows
.
"TEST",TEST,TEST,TEST"

My JavaScript code:-

data = data.replaceAll('"','"');

Please guide me if there is a better way to do this or this is really good approach?

Phil
  • 157,677
  • 23
  • 242
  • 245

1 Answers1

0

ReplaceAll function was deprecated and not supported for IE browser.

I have used regEx with replace function to do this and working fine.

if(data  && data.indexOf('"') >= 0)
     data = data.replace(/"/g,'"');