Skip to content

Instantly share code, notes, and snippets.

@christ776
Created April 26, 2016 18:38
Show Gist options
  • Save christ776/c98ed360a10678f8ca86ac79213ce4af to your computer and use it in GitHub Desktop.
Save christ776/c98ed360a10678f8ca86ac79213ce4af to your computer and use it in GitHub Desktop.
let replaced = String(challengeName.characters.flatMap {
$0 == "#" ? nil : $0
})
@christ776
Copy link
Author

Swifty way of replacing individual characters, instead of using stringbyreplacingoccurrencesofstring.

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