How to format string in Dot Net?

 Posted by Rajesh_Kumar on 1/21/2014 | Category: C# Interview questions | Views: 830 | Points: 40

With the help of String.Format method,we can format any string in Dot Net like below:-

string str = string.Format("My Name is:{0} and Age is:{1}", "Rajesh", "29");


Output:My Name is:Rajesh and Age is:29

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response