Skip to content

Instantly share code, notes, and snippets.

@fsouza
Created July 31, 2013 14:23
Show Gist options
  • Select an option

  • Save fsouza/6122425 to your computer and use it in GitHub Desktop.

Select an option

Save fsouza/6122425 to your computer and use it in GitHub Desktop.
package str
func Reverse(input string) string {
runes := []rune(input)
half := len(runes) / 2
for i := 0; i < half; i++ {
runes[i], runes[i + half] = runes[i + half], runes[i]
}
return string(runes)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment