title: Swift 2 - Search in string and sum the numbers
body: <p>My old code was:</p>
  
  <pre><code>let comps = split(str, { $0 == "-" || $0 == " " }, maxSplit: Int.max, allowEmptySlices: false)
  </code></pre>
  
  <p>after update of Swift 2 my XCode 7 fix it to:</p>
  
  <pre><code>let comps = split(str.characters, { $0 == "-" || $0 == " " }, maxSplit: Int.max, allowEmptySlices: false).map { String($0) }
  </code></pre>
  
  <p>but now I have an error: <code>Cannot invoke 'map' with an argument list of type '((_) -&gt; _)'</code></p>
  
  <p>How to fix it.</p>
  
  <p><a href="https://stackoverflow.com/questions/25508398/swift-search-in-string-and-sum-the-numbers">Link to old answer on Swift</a></p>