What is the difference between a regular string and a verbatim string?

A verbatim string is one that does not need to be escaped, like a filename:

string myFileName = "C:\\myfolder\\myfile.txt";

would be

string myFileName = @"C:\myfolder\myfile.txt";

The @ symbol means to read that string literally, and don’t interpret control characters otherwise.

Leave a Comment