Windows Phone Developers

Friday, January 2, 2009

Newline Characters in C#

How to use New Line Characters in C#

NewLine characters can be used in variables in the form of escape sequences (\n for the NewLine character) as shown below

Console.WriteLine("Name:\tPraveen Dhaggay\nAge:\t34\nOccupation:\tConsultant");

The output will be:


Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

1 comment:

  1. do you know whether this outputs a CRLF sequence, or just an LF? Does it depend on the platform?

    ReplyDelete

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005