title: cannot convert value of type 'Int' to expected argument type 'Range<String.Index>
body: <p>Trying to make a function in Swift Spritekit, this is how it looks like:</p>
  <pre><code>func card_vals(card_value_set: [Int], card_set: [String]) {
          var card_value_set = card_value_set
          var card_set = card_set
          for i in card_set {
              var j = Int(i[0])
                  card_value_set.append(j)
              }
      }
   
  </code></pre>
  <p>In simple words, the function is taking a card_set, looking like [&quot;3C&quot;, &quot;4D&quot;] which is a Str list, and the card_value_set should look like [3,4], which is a Int list.
  However, I am getting the following error:</p>
  <pre><code>cannot convert value of type 'Int' to expected argument type 'Range&lt;String.Index&gt;
  </code></pre>
  <p>Any help to erase this error?</p>
  <p>Thanks</p>