How can I convert:
from:
'\\x3c
'
to:
'<
';
I tried:
s=eval(s.replace("\\\\", ""));
does not work. How I do this? Thanks in advance!
Use String.fromCharCode
instead of eval
, and parseInt
using base 16:
s=String.fromCharCode(parseInt(s.substr(2), 16));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With