0

I have the following string:

Backpacks‎

Which if you copy and paste into the website http://asciivalue.com/ to examine each ascii char inside that string, you can see that after the text 'Backpacks' there is the ascii value: ‎ , this value messes up when I try to write the string to a csv file, as it will get outputted as Backpacks‎

I have tried using .replace functions like subcategoryStr.replace(/[^\x00-\x7F]/g, ""); and replace(/[^\x20-\x7E]/g, ''); to remove any of these invisible nonstandard ascii but no luck, how can I remove this invisible character from a string in javascript?

Martin
  • 1,336
  • 4
  • 32
  • 69

0 Answers0