[Golang] Reverse a String


Reverse a string using for or range keyword in Go programming language. For example, stressed will become desserts after reversed.

range iteration

Run Code on Go Playground

func Reverse(s string) (rs string) {
      for _, runeValue := range s {
              rs = string(runeValue) + rs
      }
      return
}