@prefix는 기호 다음에 오는 문자열에서 특수 문자를 이스케이프할 필요가 없다는 것을 나타냅니다.
다음 진술
@"D:\new"
같음:
"D:\\new"
@ 접두사는 큰 문자열을 원하고 여러 줄에 걸쳐 표시하려는 경우에도 사용됩니다. 다음은 여러 줄 문자열을 보여주는 예입니다 -
예
using System;
namespace Demo {
class Program {
static void Main(string[] args) {
string str = @"Welcome User,
Kindly wait for the image to
load";
Console.WriteLine(str);
}
}
} 출력
Welcome User, Kindly wait for the image to load