在VB中替换引号时如何在替换函数中使用转义字符

Rob*_*ert 5 vb.net escaping character quotations

这是我的代码片段:

 Public Function convert(ByVal robert As String)
        Try
            robert = Replace(robert, "U", "A")
            robert = Replace(robert, "\"", "A")
Run Code Online (Sandbox Code Playgroud)

我想用A替换"引用",但程序似乎没有认识到我在VB中使用转义字符的事实.有谁知道为什么?谢谢!

罗伯特

编辑rlbond86:这显然是Visual Basic代码.我更改了标题和文字以反映这一点.

Jon*_*and 10

看起来像VB,而不是c ++.

http://www.codingforums.com/archive/index.php/t-20709.html

你想用:

robert = Replace(robert, chr(34), "A")
Run Code Online (Sandbox Code Playgroud)

要么

robert = Replace(robert, """", "A")
Run Code Online (Sandbox Code Playgroud)

使用"作为转义字符

另见:http://www.codecodex.com/wiki/index.php? title=Escape_sequences有关多种语言的转义序列的信息