m in line. How to do it? Tried: @"Geek Answers HandbookDouble quotes inside an HTML stringI want to save this:<span class="icon phone">m</span> in line. How to do it?Tried: @"<span class="+"icon phone"+">m</span>";Tried: @"<span class=" +@ "icon phone"+">m</span>";Please, help!+4string c #Coder Apr 25 '13 at 19:13source share7 answersuse single quotes. var html = "<span class='icon phone'>m</span>"; or double quotes in a string string var html = @"<span class=""icon phone"">m</span>"; or remove quotation marks with backslash character var html = "<span class=\"icon phone\">m</span>"; +6Mike corcoran Apr 25 '13 at 19:14source shareYou can also omit @ and avoid double quotation marks using the backslash \ : "<span class=\"icon phone\">m</span>" +1MPelletier Apr 25 '13 at 19:16source shareWhat about new XElement("span", new XAttribute("class", "icon phone"), "m").ToString() +1Colonel panic Apr 25 '13 at 19:49source shareYou can do this by typing "twice". It will appear once inside the @ -line.So, in your case, to save: <span class="icon phone">m</span> Your line will be: string s = @"<span class=""icon phone"">m</span>"; 0Luis miguel serrano Apr 25 '13 at 19:14source shareTo save quotation marks in a string, you must mask it:You can mask either string mystring = @"<span class=""icon phone"">m</span>"; , or by masking quotes directly using the backslash (\) string mystring = "<span class=\"icon phone\">m</span>"; .0jAC Apr 25 '13 at 19:15source shareJust String html = "<span class=\"icon phone\">m</span>" Or you can use a string literal: String html = @"<span class=""icon phone"">m</span>" what he.0Kai Apr 25 '13 at 19:16source sharetry the following: string str="<span class=\"icon phone\">m</span>"; 0Kf2 Apr 25 '13 at 19:16source shareMore articles:ode integration in python results compared to math - pythonUse Exchange property in Camel DSL "to" - javaSite Scripting Prevention - wordpressNumpy: finding the difference between two files containing float values - pythonTransition event does not fire sequentially in FireFox without overflow hidden - jqueryMyBatis does not return all query results - sqlInternationalization in CakePHP JavaScript Files - phpget average interaction time for service requests by timestamp - sqlHow to prerender variable in angular directive for ng-repeat? - angularjsInput Type File Doesn't Work in Bootstrap Modal - html5All Articles
I want to save this:
<span class="icon phone">m</span>
in line. How to do it?
Tried: @"<span class="+"icon phone"+">m</span>";
@"<span class="+"icon phone"+">m</span>";
Tried: @"<span class=" +@ "icon phone"+">m</span>";
@"<span class=" +@ "icon phone"+">m</span>";
Please, help!
use single quotes.
var html = "<span class='icon phone'>m</span>";
or double quotes in a string string
var html = @"<span class=""icon phone"">m</span>";
or remove quotation marks with backslash character
var html = "<span class=\"icon phone\">m</span>";
You can also omit @ and avoid double quotation marks using the backslash \ :
\
"<span class=\"icon phone\">m</span>"
What about
new XElement("span", new XAttribute("class", "icon phone"), "m").ToString()
You can do this by typing "twice". It will appear once inside the @ -line.
So, in your case, to save:
Your line will be:
string s = @"<span class=""icon phone"">m</span>";
To save quotation marks in a string, you must mask it:
You can mask either string mystring = @"<span class=""icon phone"">m</span>"; , or by masking quotes directly using the backslash (\) string mystring = "<span class=\"icon phone\">m</span>"; .
string mystring = @"<span class=""icon phone"">m</span>";
(\)
string mystring = "<span class=\"icon phone\">m</span>";
Just
String html = "<span class=\"icon phone\">m</span>"
Or you can use a string literal:
String html = @"<span class=""icon phone"">m</span>"
what he.
try the following:
string str="<span class=\"icon phone\">m</span>";