473,238 Members | 3,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

Quotes in C#

Hello,

I have the following code:

StringBuilder paper = new StringBuilder();
paper.AppendLine(string.Format("<div id=""Document""
class=""ScribdIPaper""></div>", client));

In VB.NET "" in a string translates into a ".

In C# this is not working. How can I make this render the "?

Thanks,
Miguel
Sep 8 '08 #1
4 1554
shapper wrote:
Hello,

I have the following code:

StringBuilder paper = new StringBuilder();
paper.AppendLine(string.Format("<div id=""Document""
class=""ScribdIPaper""></div>", client));

In VB.NET "" in a string translates into a ".

In C# this is not working. How can I make this render the "?
paper.AppendLine(string.Format(
"<div id=\"Document\" class=\"ScribdIPaper\"></div>", client));
--
Rudy Velthuis http://rvelthuis.de

"Learning is what most adults will do for a living in the 21st
century." -- Perelman
Sep 8 '08 #2
"shapper" <md*****@gmail.comwrote in message
news:49**********************************@z72g2000 hsb.googlegroups.com...
In VB.NET "" in a string translates into a ".

In C# this is not working. How can I make this render the "?
\"
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 8 '08 #3
On Sep 9, 3:16*am, shapper <mdmo...@gmail.comwrote:
Hello,

I have the following code:

StringBuilder paper = new StringBuilder();
paper.AppendLine(string.Format("<div id=""Document""
class=""ScribdIPaper""></div>", client));

In VB.NET "" in a string translates into a ".

In C# this is not working. How can I make this render the "?

Thanks,
Miguel
use \"

-Cnu
Sep 9 '08 #4
shapper wrote:
Hello,

I have the following code:

StringBuilder paper = new StringBuilder();
paper.AppendLine(string.Format("<div id=""Document""
class=""ScribdIPaper""></div>", client));

In VB.NET "" in a string translates into a ".

In C# this is not working. How can I make this render the "?

Thanks,
Miguel
You either escape the quotation mark using a backslash:

paper.AppendLine(string.Format("<div id=\"Document\"
class=\"ScribdIPaper\"></div>", client));

Or use an @-delimited string:

paper.AppendLine(string.Format(@"<div id=""Document""
class=""ScribdIPaper""></div>", client));
There is something missing in your code, though. There is no format
specifier in the format string, so the client value isn't included in
the string.

--
Göran Andersson
_____
http://www.guffa.com
Sep 9 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Martin Goldman | last post by:
Hello all, I've been struggling for a few days with the question of how to convert "smart" (curly) quotes into straight quotes. I tried playing with the htmlentities() function, but all that is...
6
by: Cyrus D. | last post by:
Hi guys, I haven't done that much research on this topic but it seems I can use either the single quotes or the double quotes. SInce I am so used to C(++) I prefer the double quotes and am...
11
by: Jakanapes | last post by:
Hi all, I'm looking for a way to scan a block of text and replace all the double quotes (") with single quotes ('). I'm using PHP to pull text out of a mySQL table and then feed the text into...
4
by: Gerald Aichholzer | last post by:
Hello, I need to specify the following attribute in an xhtml-file containing TAL templates: <div tal:attributes="onMouseOver concat('func(',xyz,')')"> which results in <div...
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double...
4
by: (PeteCresswell) | last post by:
Is his just a flat-out "No-No" or is there some workaround when it comes time for SQL searches and DAO.FindFirsts against fields containing same? I can see maybe wrapping the value searched for...
7
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
3
by: Balaskas Evaggelos | last post by:
Hi to all, I am developing a php web browser application. But i have a problem. I am listing with opendir but there are a lot of files with quotes in their names. example: News Letter...
4
by: Michael Yanowitz | last post by:
Hello: If I have a long string (such as a Python file). I search for a sub-string in that string and find it. Is there a way to determine if that found sub-string is inside single-quotes or...
5
by: Brigitte Behrmann | last post by:
Please can some-one help, I cannot get this to work. <html> <head> <title>Random Proverbs</title> <script type="text/javascript"> <!-- HIDE FROM INCOMPATIBLE BROWSERS function changeQuote() {...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.