String Builder

G

Guest

How can i implement the following string in c#. I declared temp as
stringbuilder:

temp.Append("<span style=""font-family:Arial;
font-weight:bold;font-size:12px; color:")

i keep getting the eror due to ; insie the string

Thanks
Manny
 
D

Darrel

temp.Append("<span style=""font-family:Arial;
font-weight:bold;font-size:12px; color:")

I don't know C#, but I've found double-quotes a painful way to escape inside
a string. Try using single quotes:

temp.Append("<span style='font-family:Arial;
font-weight:bold;font-size:12px; color")

-Darrel
 
J

John M Deal

The problem isn't the ; it is that the "" after the style= attribute. C#
sees the first " as an end to the string, then gets confused about what
to do with the second one. To fix this you will need to escape the
double quote using \" instead. This would be your new line in C#:

temp.Append("<span style=\"font-family:Arial;
font-weight:bold;font-size:12px; color:")

Have A Better One!

John M Deal

----ORIGINAL MESSAGE---
How can i implement the following string in c#. I declared temp as
stringbuilder:

temp.Append("<span style=""font-family:Arial;
font-weight:bold;font-size:12px; color:")

i keep getting the eror due to ; insie the string

Thanks
Manny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top