By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,444 Members | 3,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,444 IT Pros & Developers. It's quick & easy.

need short replace example

P: n/a
Hi!...

If i have an string like this "hello world" (with the
quotes) who can i make a replace the quotes by the same in
HTML?

I try this:

word.Replace(""", """);

but shows me an error...
Thanks.
July.
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
word = word.Replace ( "\"", """ );

if your wanting to convert strings of text though, check out the HTML
encoder, which does all this sort of thing for you.

Dan.
"July Hollow" <an*******@discussions.microsoft.com> wrote in message
news:12*****************************@phx.gbl...
Hi!...

If i have an string like this "hello world" (with the
quotes) who can i make a replace the quotes by the same in
HTML?

I try this:

word.Replace(""", "&quot;");

but shows me an error...
Thanks.
July.
Nov 15 '05 #2

P: n/a
July Hollow <an*******@discussions.microsoft.com> wrote:
Hi!...

If i have an string like this "hello world" (with the
quotes) who can i make a replace the quotes by the same in
HTML?

I try this:

word.Replace(""", "&quot;");

but shows me an error...


You need to escape the double quote:

word = word.Replace ("\"", "&quot;");

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3

P: n/a
Thanks to both...
Regards.
July
-----Original Message-----
July Hollow <an*******@discussions.microsoft.com> wrote:
Hi!...

If i have an string like this "hello world" (with the
quotes) who can i make a replace the quotes by the same in HTML?

I try this:

word.Replace(""", """);

but shows me an error...


You need to escape the double quote:

word = word.Replace ("\"", """);

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.