Skip to content

Instantly share code, notes, and snippets.

@tkausch
Created October 23, 2020 15:05
Show Gist options
  • Save tkausch/00bb12a9973a4a41a04482818848ab29 to your computer and use it in GitHub Desktop.
Save tkausch/00bb12a9973a4a41a04482818848ab29 to your computer and use it in GitHub Desktop.
How to reverse a string
let str = "Hello, world!"
let reversed = String(str.reversed())
print(reversed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment