進哥的布拉格

Chin Gooole's Blog

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

From http://msdn.microsoft.com/en-us/library/aa691090(VS.71).aspx

 

using System;
class A
{
        
public static void Main()
        {

            
string a = "hello, world";                  // hello, world
            string b = @"hello, world";               // hello, world
            string c = "hello \t world";               // hello     world
            string d = @"hello \t world";               // hello \t world
            string e = "Joe said \"Hello\" to me";      // Joe said "Hello" to me
            string f = @"Joe said ""Hello"" to me";   // Joe said "Hello" to me
            string g = "\\\\server\\share\\file.txt";   // \\server\share\file.txt
            string h = @"\\server\share\file.txt";      // \\server\share\file.txt

            Console.WriteLine(a);
            Console.WriteLine(b);
            Console.WriteLine(c);
            Console.WriteLine(d);
            Console.WriteLine(e);
            Console.WriteLine(f);
            Console.WriteLine(g);
            Console.WriteLine(h);
        }
}

輸出結果:

hello, world
hello, world
hello    world
hello "t world
Joe said "Hello" to me
Joe said "Hello" to me
""server"share"file.txt
""server"share"file.txt


posted on 2008-10-28 17:56  進哥  阅读(95)  评论(0编辑  收藏  举报