22
1
using System;
2
using System.Text;
3
4
public class Program
5
{
6
public static void Main()
7
{
8
9
string a = "hi";
10
a.Replace("hi","Yi"); //Imuutable
11
12
StringBuilder sb = new StringBuilder("hi");
13
sb.Replace(sb.ToString(),"Yi"); // Mutables
14
15
Console.WriteLine(a);
16
Console.WriteLine(sb.ToString());
17
18
19
}
20
21
22
}
Cached Result