What is the use of AppendFormat method in StringBuilder?

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

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");
Response.Write(sb1.ToString());


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


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response