title: Finding # occurrences of a character in a string in Ruby
body: <p>I'm looking for the Ruby method (1.9...) that can help me find the number of occurrences of a character in a string. I'm looking for all occurrences, not just the first one.</p>
  
  <p>For example: "Melanie is a noob"
  There are two occurrences of the letter 'a'.
  What would be the Ruby method I could use in order to find this?</p>
  
  <p>I've been using <a href="http://Ruby-doc.org" rel="noreferrer">Ruby-doc.org</a> as a reference and the <code>scan</code> method in the <code>String: class</code> caught my eye. The wording is a bit difficult for me to understand, so I don't really grasp the concept of <code>scan</code>.</p>
  
  <p><strong>Edit: I was able to solve this using <code>scan</code>. <a href="https://www.youtube.com/watch?v=meuPRXSbmjw" rel="noreferrer">I shared in a video</a> how I achieved it.</strong></p>