What is the use of AppendLine in StringBuilder?

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

AppendLine method is used to Append string value in a New Line.

StringBuilder sb = new StringBuilder();

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


//Output would be:Rajesh Kumar
Sathua //new line


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response