Last active
May 24, 2016 03:37
-
-
Save gazolla/eff5195a303ccf57f23ead0ec17b8d1c to your computer and use it in GitHub Desktop.
Reverse all Strings from a sentence
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
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