Thanks everyone for your quick response.
The funny thing here is that I was escaping the " with """" but when viewing
my output in IE, the browser was itself changing the " back into " for
easy viewing, thus convincing me that it was imposible to replace a
double-quote. Once I viewed source in IE, I saw that the double-quote was
getting replaced.
Thanks again!
Kevin
"Sahil Malik" <co*****************@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You have to escape the " character, that's all.
The way to do that is replace instances of " with "".
Sample code -
Try
Dim str As String = "I ""love"" VB"
Console.WriteLine(str)
Console.WriteLine(str.Replace("""", ""))
Catch ex As Exception
Console.Write(ex.ToString())
Finally
Console.Read()
End Try
- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"Kevin Thomas" <Ke***@FakeEmailAddresses.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl... Hi there,
If I have a string var, strFoo that contains double-quotes such that it
looks like this: I "love" VB
What do I pass into the "replace" method to replace the double-quotes
with
something else?
strFoo = strFoo.replace(???,""")
In other words, what would I pass in inplace of the ??? above to get rid
of any double quotes in the string var strFoo?
Thanks,
Kevin