vb中字符串中怎么输入双引号(")或单引号(')?

hellowbh 2003-07-30 03:38:01
比如 stra=" you say:"hello" "?

在 c语言里用"\"做转义符可输入 "you say:\" hello\" "

vb里怎么输入呢?
...全文
9043 15 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
hellowbh 2003-08-05
  • 打赏
  • 举报
回复
大家好热情呀。谢谢大家。
laker_tmj 2003-07-30
  • 打赏
  • 举报
回复
up learn
hc_z 2003-07-30
  • 打赏
  • 举报
回复 1
Dim stra As String
stra = " you say:" & """" & "hello" & """"
MsgBox stra
stra = " you say: "" hello """
MsgBox stra
aalei 2003-07-30
  • 打赏
  • 举报
回复
stra=" you say:""hello"""
stra=" you say:"'"hello"'""
Alicky 2003-07-30
  • 打赏
  • 举报
回复
stra=" you say:"& chr(34) & "hello & & chr(34) & " "
zhuixing 2003-07-30
  • 打赏
  • 举报
回复
stra=" you say:""hello"""
stra=" you say:"'"hello"'""

饮水需思源 2003-07-30
  • 打赏
  • 举报
回复
text1.text=replace(text1.text,"'","''")
jason2008 2003-07-30
  • 打赏
  • 举报
回复
双引号:
"" 就是说一个双引号要写成两个双引号,如:a="hello""::"

单引号:
直接写在双引号内就行了,如:"'"
lihonggen0 2003-07-30
  • 打赏
  • 举报
回复
Dim str As String
str = " you say:""hello"""
MsgBox str

str = """"
MsgBox str

str = "'"
MsgBox str
lihonggen0 2003-07-30
  • 打赏
  • 举报
回复
Dim str As String
str = " you say:""hello"""
MsgBox str

str = """"
MsgBox str

str = "'"
MsgBox str
holydiablo 2003-07-30
  • 打赏
  • 举报
回复
或者
chr(34) "
chr(39) '
lihonggen0 2003-07-30
  • 打赏
  • 举报
回复
Dim str As String
str = " you say:""hello"""
MsgBox str

str = """"
MsgBox str

str = "'"
MsgBox str
lihonggen0 2003-07-30
  • 打赏
  • 举报
回复
Dim str As String
str = " you say:""hello"""
MsgBox str

str = """"
MsgBox str

str = "'"
MsgBox str
holydiablo 2003-07-30
  • 打赏
  • 举报
回复
"""
"'"
victorycyz 2003-07-30
  • 打赏
  • 举报
回复
双引号:
stra=" you say:""hello"" "

单引号没有特殊写法:
stra=" you say:‘hello’ "

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧