title: Iterate over a string with #split method, how to get the total number of elements
body: <p>I have the following code</p>
  
  <pre><code>s = 'string1, string2, string3, string4'
  
  s.split(",").each_with_index{ |element, index| puts "line #{index} of #{size_of_array}" }
  </code></pre>
  
  <p>What is the best way to get the size of the array ? Is there a method that I can call on the same line of the split passing to the loop ?</p>