Last active
January 11, 2016 21:44
-
-
Save lnds/cdf388705574fefd57a7 to your computer and use it in GitHub Desktop.
For con enumerate en swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i,c) in chars.enumerate() { | |
if i >= tam { | |
return nil | |
} else if c < "0" || c > "9" { | |
return nil | |
} else { | |
let digito = Int(String(c))! | |
if num.contains(digito) { | |
return nil | |
} | |
num.append(Int(String(c))!) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment