Skip to content

Instantly share code, notes, and snippets.

@megabites2013
Created March 26, 2021 10:50
Show Gist options
  • Save megabites2013/f4dcdd5e3896d55727025331a51cee8b to your computer and use it in GitHub Desktop.
Save megabites2013/f4dcdd5e3896d55727025331a51cee8b to your computer and use it in GitHub Desktop.
func Reverse(s string) string {
runes := []rune(s)
for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
runes[i], runes[j] = runes[j], runes[i]
}
return string(runes)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment