Clash.Meta/common/utils/strings.go

10 lines
163 B
Go
Raw Normal View History

package utils
func Reverse(s string) string {
a := []rune(s)
for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
a[i], a[j] = a[j], a[i]
}
return string(a)
}