Sign in to follow this  
Calin

using double quote in a C# string

Recommended Posts

I need to use the " character in a C# string. Obviousely when I use " " " the compiler considers the second double quote as a closing quote and discards the third one. How can I override this? Thanks.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Rob Loach
You can also use '@' before your quoted string to tell it to ignore the escape characters:string file = @"C:\my\file\is\here.txt";
Console.WriteLine(file);
How would one add a "-character then?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this