title: How to replace a letter at a specific index in a string in Go?
body: <p>I want to replace a letter at a specific index in a string: <code>aaaaaaa</code> -> <code>aaabaaa</code>.  Is there a built in way to do this?  I wrote the following helper function to use in the mean time:</p>
  
  <pre><code>func main() {
      input := "aaaaaaa"
      output := replaceAtIndex(input, 'b', 3)
  }
  
  func replaceAtIndex(input string, replacement byte, index int) string {
      return strings.Join([]string{input[:index], string(replacement), input[index+1:]}, "")
  }
  </code></pre>