-2

This only replaces the first ", but not the one at the end of a word

partFormatted = partFormatted.replace("\"", "");
Filburt
  • 17,626
  • 12
  • 64
  • 115
der papa
  • 35
  • 5

1 Answers1

1

Something I didn't see in the other post is using a regular expression. Specifically the global flag.

partFormatted = partFormatted.replace(/"/g, "");

The 'g' indicates it should find all given matches and replace with given input

Connor
  • 93
  • 12