Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio .NET
Samples
 Code: Generating Multiline String L...

  Switch on low bandwidth view
 
Code: Generating Multiline String Literals (Visual C#)
 

This example demonstrates two ways of constructing a multiline string literal.

Example

string myString1 = "This is the first line of my string.\n" +
                   "This is the second line of my string.\n" +
                   "This is the third line of the string.\n";
string myString2 = @"This is the first line of my string.
This is the second line of my string.
This is the third line of the string.";

Compiling the Code

Copy the code and paste it into the Main method of a console application.

See Also

string | General Language Example Topics.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker