Skip to content

Instantly share code, notes, and snippets.

@cipepser
Created December 29, 2016 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cipepser/09251fc66515bb60f15d58721c08466a to your computer and use it in GitHub Desktop.
Save cipepser/09251fc66515bb60f15d58721c08466a to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func Reverse(s string) string {
t := make([]rune, len(s))
for i, c := range s {
t[len(s) - i- 1] = c
}
return string(t)
}
func main() {
var s string = "stressed"
fmt.Println(Reverse(s))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment