String literals : Literal « Data Types « C# / C Sharp






String literals

String literals

using System;

public class EntryPoint
{
    static void Main( string[] args ) {
        string lit1 = "c:\\windows\\system32";
        string lit2 = @"c:\windows\system32";

        string lit3 = @"
line one
line two
";
        Console.WriteLine( lit3 );

        Console.WriteLine( "Object.RefEq(lit1, lit2): {0}",
                           Object.ReferenceEquals(lit1, lit2) );

    }
}

           
       








Related examples in the same category

1.Creating a literalCreating a literal