Skip to content

Instantly share code, notes, and snippets.

@gazolla
Last active May 24, 2016 03:37
Show Gist options
  • Save gazolla/eff5195a303ccf57f23ead0ec17b8d1c to your computer and use it in GitHub Desktop.
Save gazolla/eff5195a303ccf57f23ead0ec17b8d1c to your computer and use it in GitHub Desktop.
Reverse all Strings from a sentence
let sentence = "Hello, My name is Bob"
let result = sentence.characters.reversed().map { String($0) }.joined(separator:"")
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment