What is the use of AppendFormat method in StringBuilder?

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

AppendFormat is used for Formatting purpose meaning we can format our string as we want.

For Example:-

StringBuilder sb = new StringBuilder();

sb.AppendFormat("First Name:{0},Last Name:{1}", "Rajesh", "Sathua");

Output would be:-
First Name:Rajesh,Last Name:Sathua

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response