title: How do you replace a string with a hash collection value in Ruby?
body: <p>I have a hash collection:
  <code>my_hash = {"1" =&gt; "apple", "2" =&gt; "bee", "3" =&gt; "cat"}</code></p>
  
  <p>What syntax would I use to replace the first occurrence of the <code>key</code> with hash collection <code>value</code> in a string?</p>
  
  <p>eg my input string:
  <code>str = I want a 3</code></p>
  
  <p>The resulting string would be:
  <code>str = I want a cat</code></p>