how to insert quotation mark in the string using c#

Hi Team,

How to put a quotation mark in below string for http link as it does not take the escape sequence, pls help
string abc =  "<svg class="svgimage" xmlns= "http://www.w3.org/2000/svg";
console.write(abc);

I did try but no luck as xmlns part gives error

string abc =  "<svg class="\"svgimage\"" xmlns= "\"http://www.w3.org/2000/svg\"";
console.write(abc);

Open in new window

satmishaAsked:
Who is Participating?
 
käµfm³d 👽Commented:
You put too many quotes inside the string. Just escape the quote itself:

string abc =  "<svg class=\"svgimage\" xmlns= \"http://www.w3.org/2000/svg\"";

Open in new window

0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Try using a single quote mark ' instead of the double quote.
0
 
Chinmay PatelEnterprise ArchitectCommented:
Append @ at the beginning of your string. String x = @"xml string" ;
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
satmishaAuthor Commented:
Thanks, guys but none of it working ... the issue occurs at xmlns tag as http one gives error. pls suggest what other options i have ?

sbTemp.AppendLine("<svg class=\"svgimage\" + xmlns= \"http://www.w3.org/2000/svg\"");

expected

 <svg class="svgimage" xmlns="http://www.w3.org/2000/svg"

Open in new window

0
 
AndyAinscowFreelance programmer / ConsultantCommented:
You do have a closing > symbol at the end of the tag I hope?
0
 
satmishaAuthor Commented:
Thanks AndyAinsCow.

I afraid that still issue is there :-(
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
What is the exact error you get?


also if you did something like
String s = "<svg class=\"svgimage\" + xmlns= \"http://www.w3.org/2000/svg\"";
console.Write(s)

What do you get as the output ?
0
 
käµfm³d 👽Commented:
Saying "not working" instead of showing what the output you get or the behavior you are witnessing is not helpful. Imagine if a user came up to and said, "the application is not working." What would your first question be?
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Asker did not do what was suggested.  This should produce the correct output.
0
All Courses

From novice to tech pro — start learning today.