title: What's the shortest way to count substring occurrence in string? (Elixir)
body: <p>Right now I have been using <code>Regex.scan</code> method:</p>
  
  <pre><code>Regex.scan(~r/do/i, “Do. Or do not. There is no try.") |&gt; length
  </code></pre>
  
  <p>In Ruby, we can use <code>.scan</code> method: <code>"Hello world".count "o" #=&gt; 2</code></p>
  
  <p>Is there a shorter method to count substring in a string with Elixir? No need for fancy regex, I just need to count how many substring in a string.</p>