mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
refactor: change ReverseStr to Reverse in strutil package
This commit is contained in:
1 parent
3c2e0ca5b3
commit
ab0716a472
2 files changed
+6
-6
No files matched your search
+2
-2
@@ -208,8 +208,8 @@ func IsString(v any) 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]
|
||||
|
||||
Reference in new issue
Block a user