Does javascript have literal strings?

后端 未结 6 1942
醉酒成梦
醉酒成梦 2020-12-05 12:48

In c# and ruby and many other languages you can denote a string as to not need escaping.
in c# its like this



        
6条回答
  •  醉梦人生
    2020-12-05 13:29

    This will work as long as you don't throw a \x into the string!

    var str = String.raw`\whatever\this\is`;
    
    console.log(str);

提交回复
热议问题