插入倒逗号(“”)转换为字符串的Visual BasicVisual Basic字符串执行
Dim str As String
str = "*.doc" & "," & "*.docx"
我想文本框中显示"*.doc" & "," & "*.docx"
插入倒逗号(“”)转换为字符串的Visual BasicVisual Basic字符串执行
Dim str As String
str = "*.doc" & "," & "*.docx"
我想文本框中显示"*.doc" & "," & "*.docx"
它根本不清楚你在问什么。如果你这样做,结果字符串将是*.doc,*.docx
。如果你想倒逗号(引号),你会做这样的事情:
str = Chr$(34) & "*.doc" & Chr$(34) & "," & Chr$(34) & "*.docx" & Chr$(34)
这将产生类似
"*.doc","*.docx"
这是你在找什么?如果没有,让我们知道你想要完成什么,我们可以帮助你。
写入字符串,只要你想它代表:
str = "*.doc" & "," & "*.docx"
双引号逃脱他们:
str = ""*.doc"" & "","" & ""*.docx""
然后引用串整:
str = """*.doc"" & "","" & ""*.docx"""
?str
"*.doc" & "," & "*.docx"
我测试了这个与一个消息框,它为我工作得很好。
Dim str As String = "*.doc" & "," & "*.docx"
textbox1.text = str
这对我有用,试试吧。
Dim str As String = """ * .doc"" & "","" & ""*.docx """
TextBox1.Text = str
VB6代码:
Dim str As String
str = "*.doc" & "," & "*.docx"
Text1.Text = str
VB.net代码:
Dim str As String
str = "*.doc" & "," & "*.docx"
TextBox1.Text = str
这两项工作。