Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to add this string into the "" (double quota)...

eg like "<img src='resources/images/stumb.png' />"

C#
for (int i = 0; i < objProp.Count; i++)
{
if (i == objProp.Count - 1)
{
Image = Image + "<img src='Template/Resources /images/wmLarge_" + objProp[0].PropertyTitle.ToString() + "'/>";
}
else
{
Image = Image + "<img src='Template/Resources/images/wmLarge_" + objProp[0].PropertyTitle.ToString() + "'/>,";
}
}
Posted
Updated 8-May-12 14:30pm

Use escape sequence '\' backlash to create string of ""(double quotes)

string Image = Image + "\"" + " <img height="60" width="60" src="Upload/saAdsImages/wmSmall_a.jpg" />" + "\"";
 
Share this answer
 
v2
<img src='resources/images/stumb.png' />
Two ways:
1. Use escape sequence '\' backlash for special character like '''. Details here: MSDN: Escape Sequences[^]
C#
string myImage = "<img src=\'resources/images/stumb.png\' />";


2. Just put '@' at the beginning of the string:
C#
string myImage = @"<img src='resources/images/stumb.png' />";
 
Share this answer
 
I use escape sequence '\' backlash to create string of ""(double quotes),
and use '@' to create string \ (eg: @"Server\EXPRESS".
 
Share this answer
 
i am not sure what exactly you are looking for. Positively, you need escape character to put quotation marks in string, if i am not wrong.
you can use \ for this purpose.

e.g.
C#
string s = "My name is \"Khan\"";


This will result in :
My name is "Khan"


Ref: http://msdn.microsoft.com/en-us/library/h21280bw.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900