13 lines
412 B
Go
13 lines
412 B
Go
// package moarstrings implements additional functions to manipulate utf8
|
|
// encoded strings, beyond what is provided in the standard "strings" package.
|
|
package moarstrings
|
|
|
|
// ReverseRunes returns its argument string reversed rune-wise left to right.
|
|
func ReverseRunes(s string) string {
|
|
r := []rune(s)
|
|
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
|
|
r[i], r[j] = r[j], r[i]
|
|
}
|
|
return string(r)
|
|
}
|