Saturday, March 24, 2012

super simple asp question

I'm tryinh to write a restricted character into a variable and i'm not sure what the replacement is.

Basically I want to put a " inside a variable string.

like:

Body = "And he said: "blah blah blah." "

Any idea how to do that and not have the string break?

i'm going to be writing xml with asp and pulling data from a form and I know xml is really sensitive and an apostraphe over quotations won't cut it.

Thanks.

well i know for c# it is string mystring = "hello world\\". you have to use double the \

EDIT: not sure why i used \ in the example, but for a quote you do it the same way string mystring = "hello \"world\"'; giving you hello "world"


In VB.NET you simply double your quotes like so:

Dim strTest As String = "President Bush said ""No Comment"" in response to my question."


ok i'll try these, thanks for your help :)

0 comments:

Post a Comment