Skip to content

Instantly share code, notes, and snippets.

@lnds
Last active January 11, 2016 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lnds/cdf388705574fefd57a7 to your computer and use it in GitHub Desktop.
Save lnds/cdf388705574fefd57a7 to your computer and use it in GitHub Desktop.
For con enumerate en swift
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