title: Swift - Find character at several positions within string
body: <p>In Swift, with the following string: <code>&quot;this is a string&quot;</code>, how to obtain an array of the indexes where the character <code>&quot; &quot;</code> (space) is present in the string?</p>
  <p>Desired result: <code>[4,7,9]</code></p>
  <p>I've tried:</p>
  <pre><code>let spaces: NSRange = full_string.rangeOfString(&quot; &quot;)
  </code></pre>
  <p>But that only returns 4, not all the indexes.</p>
  <p>Any idea?</p>