How to add string values in StringBuilder.

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

There is a StringBuilder'Append method ,which is used to add string value in StringBuilder object.

StringBuilder sb = new StringBuilder();

sb.Append("Rajesh Kumar");
sb.Append(" Sathua");
MessageBox.Show(sb.ToString());


//Output would be:Rajesh Kumar Sathua


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response