如何双引号变量字符串? [英] How to double quote a variable string?

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

问题描述

我想知道如何在字符串变量中添加双引号。例如,

Hi, I''d like to know how to add double quote to a string variable. For example,

展开 | 选择 | Wrap | 行号

推荐答案

如果我理解正确,我认为你''非常接近...


文件名变量名需要附加到字符串的其余部分,因此您可以执行以下操作:
If I''m understanding it right, I think you''re very close...

The "filename" variable name needs to be appended to the rest of the string, so you could do something like:
展开 | 选择 <跨度类= codeDivider> | <跨度类= codeLink 的onclick = 自动换行(在此);>裹 | 行号


我试过了,但得到

arguments =" -i \" C:\\my file \""。

如何删除2个额外的\在字符串?
I tried that, but get
arguments = "-i \"C:\\my file\"".
How to remove 2 extra "\" in the string?


我想你可能会对使用逐字文字(@符号)感到困惑。如果你在字符串之前使用它,那么将包含所有转义字符(如额外的''\'')。
I think you may be getting confused with the use of the verbatim literal (@ symbol). If you''re using this before the string, then all escape characters (like the extra ''\'') will be included.


这篇关于如何双引号变量字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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