使用引用作为文字 [英] Using a quote as a literal
问题描述
我如何使用引号作为文字,因此它确实混淆为不是文字?
谢谢!
鲍勃
How can I use a quote as a literal so it does get confused as not a literal?
Thanks!
Bob
推荐答案
6月5日上午9:43,BobAchgill< BobAchg ... @ discussion.microsoft.com>
写道:
On Jun 5, 9:43 am, BobAchgill <BobAchg...@discussions.microsoft.com>
wrote:
如何使用引号作为文字,因此它确实混淆为不是文字?
谢谢!
Bob
How can I use a quote as a literal so it does get confused as not a literal?
Thanks!
Bob
报价可以通过加倍来逃避。
Dim s as String ="< img src ="" image1.jpg"">"
Quotes can be escaped by doubling.
Dim s as String = "<img src=""image1.jpg"">"
BobAchgill < Bo ******** @ discussion.microsoft.com写信息
新闻:8E ******************** ************** @ microsof t.com ...
"BobAchgill" <Bo********@discussions.microsoft.comwrote in message
news:8E**********************************@microsof t.com...
如何使用引号作为文字,以便它混淆为不是
字面值?
谢谢!
Bob
How can I use a quote as a literal so it does get confused as not a
literal?
Thanks!
Bob
如果您的意思是在字符串中,请尝试以下内容:
Label1.Text ="这会显示引号=""!" ;
感叹号前的双引号将显示为单个
引用,是文字的一部分。
If you mean within a string, try something like this:
Label1.Text = "This displays a quotation mark = ""!"
The double quotes before the exclamation mark will display as a single
quote, part of the literal.
" pvdg42"写道:
"pvdg42" wrote:
>
" BobAchgill" < Bo ******** @ discussion.microsoft.com写信息
新闻:8E ******************** ************** @ microsof t.com ...
>
"BobAchgill" <Bo********@discussions.microsoft.comwrote in message
news:8E**********************************@microsof t.com...
如何使用引号作为文字,以便它混淆为不是
字面值?
谢谢!
Bob
How can I use a quote as a literal so it does get confused as not a
literal?
Thanks!
Bob
如果你的意思是在一个字符串中,尝试这样的事情:
Label1.Text ="这会显示一个引号=""!" ;
感叹号前的双引号将显示为单个
引用,是文字的一部分。
If you mean within a string, try something like this:
Label1.Text = "This displays a quotation mark = ""!"
The double quotes before the exclamation mark will display as a single
quote, part of the literal.
是的,但我很喜欢使用ControlChars.Quote并构建字符串
,因为我觉得它更容易阅读
guy
True, but ersonally I prefer to use ControlChars.Quote and build the string
up as I find it easier to read
guy
这篇关于使用引用作为文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!