title: How to find out if letter is Alphanumeric or Digit in Swift
body: <p>I want to count the number of letters, digits and special characters in the following string:</p>
  
  <pre><code>let phrase = "The final score was 32-31!"
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>for tempChar in phrase {
      if (tempChar &gt;= "a" &amp;&amp; tempChar &lt;= "z") {
         letterCounter++
      }
  // etc.
  </code></pre>
  
  <p>but I'm getting errors. I tried all sorts of other variations on this - still getting error - such as:</p>
  
  <blockquote>
    <p>could not find an overload for '&lt;=' that accepts the supplied arguments</p>
  </blockquote>