在VB中替换引号时如何在替换函数中使用转义字符
这是我的代码片段:
Public Function convert(ByVal robert As String)
Try
robert = Replace(robert, "U", "A")
robert = Replace(robert, "\"", "A")
我实际上想用 A 替换“引号”,但程序似乎没有识别出我在 VB 中使用转义字符的事实。 有谁知道为什么? 谢谢!
Robert
由 rlbond86 编辑:这显然是 Visual Basic 代码。 我更改了标题和文字以反映这一点。
Here is my code snippet:
Public Function convert(ByVal robert As String)
Try
robert = Replace(robert, "U", "A")
robert = Replace(robert, "\"", "A")
I want to actually replace the "quotations" with the A but the program doesn't seem to recognize the fact that I'm using an escape character in VB. Does anyone know why? Thanks!
Robert
EDIT by rlbond86: This is clearly Visual Basic code. I have changed the title and text to reflect that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来像VB,而不是C++。
请参阅http://www.codingforums.com/archive/index.php/ t-20709.html
您想要使用:
或
使用“作为转义字符
另请参阅:http://www.codecodex.com/wiki/index.php?title=Escape_sequences 有关多种语言的转义序列的信息
Looks like VB, not c++.
See http://www.codingforums.com/archive/index.php/t-20709.html
you want to use:
or
using " as escape character
also see: http://www.codecodex.com/wiki/index.php?title=Escape_sequences For info on escape sequences in multiple languages