1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 06:32:28 +08:00

refactor: change ReverseStr to Reverse in strutil package

This commit is contained in:
dudaodong
2022-08-29 15:11:15 +08:00
parent f5ec5eb58d
commit aece2995d6
2 changed files with 6 additions and 6 deletions

View File

@@ -209,8 +209,8 @@ func IsString(v interface{}) bool {
}
}
// ReverseStr return string whose char order is reversed to the given string
func ReverseStr(s string) string {
// Reverse return string whose char order is reversed to the given string
func Reverse(s string) string {
r := []rune(s)
for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
r[i], r[j] = r[j], r[i]