32
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
string normal = "first line \n second line";
8
string verbatim = @"first line \n second line";
9
Console.WriteLine(normal);
10
// --- output:
11
// first line
12
// second line
13
14
Console.WriteLine(verbatim);
15
// --- output:
16
// first line \n second line
17
18
19
// need to use '\' to escape the backslash character
20
string filename1 = "c:\\documents\\files\\u0066.txt";
21
// ignore escape sequences
22
string filename2 = @"c:\documents\files\u0066.txt";
23
24
Console.WriteLine(filename1);
25
// --- output:
26
// c:\documents\files\u0066.txt
27
28
Console.WriteLine(filename2);
29
// --- output:
30
// c:\documents\files\u0066.txt
31
}
32
}
Cached Result