C# 字符串前加@

  public class Program
    {
        static void Main(string[] args)
        {
            //1.可以不转义
            string name = "\\a\\b\\c";
            string name2 = @"\a\b\c";
            Console.WriteLine(name);
            Console.WriteLine(name2);
            //2.可以换换行
            string shi = @"床前明月光,
疑是地上霜。";
            Console.WriteLine(shi);
            Console.ReadKey();
        }
    }

猜你喜欢

转载自blog.csdn.net/luochenlong/article/details/80624238
今日推荐