title: Replacing a char in Ruby with another character
body: <p>I'm trying to replace all spaces in a string with '%20', but it's not producing the result I want.</p>
  
  <p>I'm splitting the string, then going through each character. If the character is " " I want to replace it with '%20', but for some reason it is not being replaced. What am I doing wrong?</p>
  
  <pre><code>def twenty(string)
    letters = string.split("")
    letters.each do |char|
      if char == " "
          char = '%20'
      end
    end
  
    letters.join
  end
  
  p twenty("Hello world is so played out")
  </code></pre>