title: What's the StringBuilder equivalent in TypeScript?
body: <p>So I have this string that contains a percentage symbol <code>%</code>. I want to be able to replace it with the <code>#</code> symbol using <code>TypeScript</code>. I am still learning TypeScript so it's syntax is still throwing me off. I managed to implement the solution that I need in C# and that piece of code can be found below:</p>
  
  <pre><code> public static void Main(string[] args)
   {
       string data = "AHu%odk"; //The % character will always be at index 3
       string finalResult = "";
       if (data.Contains("%"))
       {
            StringBuilder sbFirstIndex = new StringBuilder(data);
            sbFirstIndex[3] = '#'; 
            finalResult = sbFirstIndex.ToString();
            Console.WriteLine("Appended string now looks like this: {0} \n", finalResult);
       }
       else
       {
             Console.WriteLine("False. It does not contain it");
       }
   }
  </code></pre>
  
  <p>Here is my TypeScript implementation but I got stuck if checking for the index of the character:</p>
  
  <pre><code>changePercantage(input: string): void {
      var data= "AHu%odk";
      var finalResult = ""; 
      var index = result.indexOf("%");
  
      if (index == 3) { 
          //Replace the percentage with the # character
      }
  }
  </code></pre>
  
  <p>The version of TypeScript that I am using is <code>v2.3.3.0</code>. </p>
  
  <p>Angular : <code>v5.0.0</code></p>
  
  <p>Node: <code>v8.9.3</code></p>
  
  <p>Npm: <code>v5.6.0</code></p>