Initial commit
This commit is contained in:
parent
d611f97547
commit
5f9f0b3371
3
go.mod
Normal file
3
go.mod
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module git.mimbach49.de/SiegfriedSiegert/morestrings.git
|
||||||
|
|
||||||
|
go 1.14
|
12
reverse.go
Normal file
12
reverse.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// Package morestrings implements additional functions to manipulate UTF-8
|
||||||
|
// encoded strings, beyond what is provided in the standard "strings" package.
|
||||||
|
package morestrings
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user