Vaccano Vaccano - 5 months ago 14
Javascript Question

Does typescript/javascript have a @"\" equivalent like C#?

Is there a way that I can put slashes in a string in javascript without having to put two?

In C# I could do this:

@"This\is not used as an escape\"


(The @ in front of the string makes it not use \ as an escape char.)

Is there something like this in javascript/typescript?

Answer

No, there is not this kind of escaping in javascript

String literals