var t string = "123456你好"
tmp := []rune(t)
for from, to := 0, len(tmp)-1; from < to; from, to = from + 1, to - 1{
fmt.Println(from, to)
//x := tmp[from]
//tmp[from] = tmp[to]
//tmp[to] = x
tmp[from], tmp[to] = tmp[to],tmp[from]
}
fmt.Println(string(tmp))
网友评论