tags:

views:

44

answers:

5

I have a replacement problem in VB.NET: I need to replace the " character:

result = result.Replace(""", "")

How can I make this work? Is is even possible?

+3  A: 

In a VB literal string, use "" to mean " - So

result = result.Replace("""", "")

Note the four " chars in a row - begin string, two consecutive that mean a single set, and the end of string.

Philip Rieck
+4  A: 

I dont know VB.NET but try

result = result.Replace("""", "")
Sebastian Brózda
+2  A: 
result = result.Replace("""", "")

VB uses "" to provide a " character in a string without exiting the quotes. Most other languages use an escape, such as \"

Blam
+1  A: 

Here is the code for the VB char constant "

""""c

To fix your sample, use the following

result = result.Replace("""", "")
JaredPar
+1  A: 

You need to escape it

result = result.Replace("""", "")
Wil