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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
Try using a single quote mark ' instead of the double quote.
0
Chinmay PatelChief Technical NinjaCommented:
Append @ at the beginning of your string. String x = @"xml string" ;
0
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.