Skip to content

Instantly share code, notes, and snippets.

@jimmyhillis
Created October 22, 2014 02:26
Show Gist options
  • Save jimmyhillis/c2cbf31ebf7d2923ab5b to your computer and use it in GitHub Desktop.
Save jimmyhillis/c2cbf31ebf7d2923ab5b to your computer and use it in GitHub Desktop.
Swifty
// Break a name into two
let nameParts = split(json["_name"].stringValue) { $0 == " " }
let firstName = nameParts.first
let lastName = nameParts.count > 1 ? join(" ", nameParts[1...nameParts.count-1]) : ""
@craiglonsdale
Copy link

Yeah that does look very bleh
Modern and nearly unreadable :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment