📌  相关文章
📜  在 golang 中反转字符串 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:01.507000             🧑  作者: Mango

代码示例1
func reverse(s string) string {
    runes := []rune(s)
    for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
        runes[i], runes[j] = runes[j], runes[i]
    }
    return string(runes)
}