Option ExplicitPrivate Sub Command1_Click() Dim strP As String strP = Chr(34) & "ÖйúÈË" & Chr(34) '×Ö·û´®µÄÄÚÈÝÊÇ£º"ÖйúÈË" Debug.Print strP End Sub 具体的查阅ASCII编码表格
可以如下吗? Dim str as stringstr = "hello"&""test""&"world" msgbox(str)难于理解: str = "hello ""test"" world"
str = "hello ""test"" world"
Option ExplicitPrivate Sub Command1_Click()
Dim strP As String
strP = Chr(34) & "ÖйúÈË" & Chr(34) '×Ö·û´®µÄÄÚÈÝÊÇ£º"ÖйúÈË"
Debug.Print strP
End Sub
具体的查阅ASCII编码表格
Dim str as stringstr = "hello"&""test""&"world"
msgbox(str)难于理解:
str = "hello ""test"" world"
这样写不报语法错误?1F的就是正确写法。你要想‘好理解’,就这样写吧:
str = "hello " & chr$(34) & "test" & chr$(34) & "world"