Replacing a substring in a String Builder object in C#

Using replace(), you can replace a string with a new string.

using System;
using System.Text;

namespace forgetCode
{    
    class program
    {        
        public static void Main()
        {            

            StringBuilder sb1 = new StringBuilder("Time is gold");
            sb1.Replace("is", "was");
            Console.WriteLine(sb1);
        }
    }
}


Output:
Time was gold