StringBuilder.Append : StringBuilder « System.Text « C# / C Sharp by API






StringBuilder.Append

  

using System;
using System.Text;
   
class Test {
  public static void Main() {
    StringBuilder myStringBuilder = new StringBuilder();
    string myString = "www.java2s.com";
    myStringBuilder.Append(myString);
    myStringBuilder.Append(", www.java2s.com... ");
    int myInt = 1234;
    myStringBuilder.Append(myInt);
    bool myBool = true;
    myStringBuilder.Append(myBool);
   
    myStringBuilder.Append('z', 5);
   
    myStringBuilder.Append("Here's another string", 0, 4);
   
    Console.WriteLine("myStringBuilder = " + myStringBuilder);
  }
   
}

   
    
  








Related examples in the same category

1.new StringBuilder()
2.StringBuilder.AppendFormat
3.StringBuilder.Capacity
4.StringBuilder.GetType()
5.StringBuilder.Insert
6.StringBuilder.Length
7.StringBuilder.Remove
8.StringBuilder.Replace
9.StringBuilder.ToString()