String Builder

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
Back
Top