title: Swift How to get integer from string and convert it into integer
body: <p>I need to extract numbers from string and put them into a new array in Swift.</p>
  
  <pre><code>var str = "I have to buy 3 apples, 7 bananas, 10eggs"
  </code></pre>
  
  <p>I tried to loop each characters and I have no idea to compare between Characters and Int.</p>