From: Jay on
While the @ works often apparently the double qoutes is not a character that can be escaped that way. Apparently they call it a verbatim string.



Jay Kuykendall wrote:

Escaping characters
07-Apr-10

The other way to escape characters is the @ symbol.

For example from http://www.softsteel.co.uk/tutorials/cSharp/lesson4.html

> The second approach is to use 'verbatim string'
> literals. These are defined by enclosing the required
> string in the characters @" and ". To illustrate this,
> to set the variable 'path' to the following value:

> C:\My Documents\

> we could either escape the back-slash characters

> string path = "C:\\My Documents\\"

> or use a verbatim string thus:

> string path = @"C:\MyDocuments\"

Good luck,

JDK

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk Repeating Structures Table Looping and Table Extract
http://www.eggheadcafe.com/tutorials/aspnet/73bf7539-4c13-43a5-a580-a5704fe31a76/biztalk-repeating-structu.aspx
From: Peter Duniho on
Jay Kuykendall wrote:
> While the @ works often apparently the double qoutes is not a character that can be escaped that way. Apparently they call it a verbatim string.

I have no idea why you are responding to a message three YEARS old.

But, given that you are, you may be interested to know:

� Use of the @ isn't "escaping"; it's simply "verbatim", as you've heard
� If you want a double-quote character in a verbatim character, you
simply double it: @"She said ""Hello world!"" to the world"