15 lines
196 B
Go
15 lines
196 B
Go
|
package util
|
||
|
|
||
|
func ReverseString(s string) string {
|
||
|
runes := []rune(s)
|
||
|
|
||
|
i := 0
|
||
|
j := len(runes) - 1
|
||
|
for i < j {
|
||
|
runes[i], runes[j] = runes[j], runes[i]
|
||
|
i++
|
||
|
j--
|
||
|
}
|
||
|
return string(runes)
|
||
|
}
|