24
1
using System;
2
using System.Text;
3
public class Program {
4
public static void Main() {
5
6
StringBuilder sb = new StringBuilder();
7
// Append Method
8
sb.Append("Welcome to the C# Course!");
9
10
Console.WriteLine(sb.ToString());
11
// insert
12
sb.Insert(0, "Hello user. ");
13
Console.WriteLine(sb.ToString());
14
15
//remove
16
sb.Remove(5, 5);
17
Console.WriteLine(sb.ToString());
18
19
//replace
20
sb.Replace('!', ' ');
21
Console.WriteLine(sb.ToString());
22
23
}
24
}
Cached Result