Create string with @ and no need to escape in CSharp
Description
The following code shows how to create string with @ and no need to escape.
Example
using System;
public class UsingStrings
{/*from w w w . j a va 2s . c o m*/
static void Main(string[] args)
{
string MyString = "Hello World java2s.com";
Console.WriteLine(MyString);
string Path = @"c:\Program Files";
Console.WriteLine(Path);
string Path2 = "c:\\Program Files";
Console.WriteLine(Path2);
string Name = "Joe";
Console.WriteLine(Name);
}
}
The code above generates the following result.