是否有JavaScript的文字字符串? [英] Does javascript have literal strings?

查看:84
本文介绍了是否有JavaScript的文字字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#和红宝石和许多其他语言可以表示为不需要转义的字符串。结果
在C#中的这样



<预类= 郎CSHARP prettyprint-覆盖> 字符串s = @\whatever\this\is



结果时打印

  \whatever\this\is 

我的问题是, ?在此以任何形式在JavaScript支持。


解决方案

简短的回答:没有。



龙回答:Noooooooooooooooooooooooooo


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

string s = @"\whatever\this\is";

the results are when printed

\whatever\this\is

my question is, is this supported in any form in javascript?

解决方案

Short answer: No

Long answer: Noooooooooooooooooooooooooo

这篇关于是否有JavaScript的文字字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆