title: Substitute character at an index position in Ruby
body: <p>I have a string and will like to substitute multiple characters on different positions and print that string.</p>
  
  <p>E.g.</p>
  
  <p>Here I like to substitute string at positions with string_replace.</p>
  
  <pre><code>string = "AGACACTTTATATGTAT"
  
  positions = ["2", "5", "8", "10"]
  
  string_replace = ["T", "A", "G", "G"]
  </code></pre>
  
  <p>The output I need is this => "AGTCAATTGAGATGTAT"</p>
  
  <p>I tried this but with no success:</p>
  
  <pre><code>positions.zip(string_replace).each do |pos, str|
    string.gsub!(/#{string}[#{pos}]/, '#{str}')
    puts string
  end
  </code></pre>
  
  <p>Any assistance will be appreciated.</p>