Knowledge Management Banner

Knowledge Management Banner

C# Tutotial : Concatenation & Placeholder methods, escape sequence and literals : Part 2

Concatenation Method

var temp = "Hello Ram";
Consile.Writeline("The message is : " + temp);


Placeholder Method

var temp = "Hello Ram";
Consile.Writeline("The message is :  {0}", temp);


Escape sequence in c#

\ (Back slash) is the escape sequence in c#, e.g. \n, \r.


Vertabin literal

string with @ symbol in prefix, it is used to print escape sequence as it is.
e.g. var path = @"c:\Newfolder\Hello.txt"







No comments

Powered by Blogger.