devxlogo

Escape Characters with the “@” Symbol in C#

Escape Characters with the “@” Symbol in C#

Use the “@” symbol to prefix a string that has characters. You do not have to escape the characters in the string. For example, instead of:

Var filePathString = "C:\mydocs\share\audit.docx";

We could write it as:

Var filePathString = @"C:mydocsshareaudit.docx";

devx-admin

Share the Post: