十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
package main
import (
"fmt"
)
func reverse(s string) string {
s1 := []rune(s)
for i := 0; i < len(s1)/2; i++ {
tmp := s1[i]
s1[i] = s1[len(s1)-1-i]
s1[len(s1)-1-i] = tmp
}
return string(s1)
}
func main() {
s := "123456"
fmt.Println(reverse(s))
}