I have the following string:
var str = '\x27';
I have no control on it, so I cannot write it as '\\x27' for example. Whenever I print it, i get:
'
since 27 is the apostrophe. When I call .length
on it, it gives me 1. This is of course correct, but how can I treat it like a not escaped string and have it print literally
\x27
and give me a length of 4?