-3

I have a json string and need to parse it it using JSON.parse()

but i need to remove all \x00 in my string

My json string:

'{"xd":"1","x":"285fd83"}\x00\x00\x00\x00\x00\x00\x00\x00\x00'
karlos
  • 807
  • 1
  • 8
  • 38

1 Answers1

0

How about using javascripts replaceAll method?

var myString = '{"xd":"1","x":"285fd83"}\x00\x00\x00\x00\x00\x00\x00\x00\x00';

console.log(myString.replaceAll('\x00',''));
Josh Adams
  • 2,113
  • 2
  • 13
  • 25