Skip to content

Instantly share code, notes, and snippets.

@davidsonfellipe
Last active December 20, 2015 10:39
Show Gist options
  • Save davidsonfellipe/6117723 to your computer and use it in GitHub Desktop.
Save davidsonfellipe/6117723 to your computer and use it in GitHub Desktop.
str.go
package str
func Reverse(input string) string {
inputLength := len(input)
inverted := make([]rune, inputLength)
for _, char := range input {
inputLength--
inverted[inputLength] = char
}
return string(inverted[inputLength:])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment