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'
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'
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',''));