问题描述
我在此行中放几行(双引号),以便最后将="08075"粘贴到我的excel工作表中?该行是:
How many " (double quotes) do I put around this line so that I end up with ="08075" being pasted into my excel worksheet? The line is:
Response.Write vbTab & ResultSet(8,r)
我需要在ResultSet(8,r)之前用单引号将'='加上单引号,在...之后用双引号括起来...
I need and '=' sign with a single quote before the ResultSet(8,r) with a closing double quote after... I tried:
Response.Write vbTab & "="" & ResultSet(8,r) & """
但是那行不通,再加上其他几个行列却行不通,引号的数量总是吸引我,因此,如果有人想给我关于这条规则的一般经验,我将不胜感激.
but that didn't work, plus a couple others but that didn't work, the number of quotes thing always gets me so if someone wants to give me a general rule of thumb on this one I would really appreciate it.
推荐答案
要在VBScript中的字符串中获取文字双引号("
),您需要使用两个双引号(""
).因此,对于您的示例:
To get a literal double quote ("
) inside of a string in VBScript, you need to use two double quotes (""
). So for your example:
Response.Write vbTab & "=""" & ResultSet(8,r) & """"
' ^ ^ ^ ^ These delimit the string
' ^^ ^^ These create literal quotes
这篇关于格式化行,以便最终得到="08075"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!