We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3717ffb commit edefd68Copy full SHA for edefd68
strings.go
@@ -46,13 +46,7 @@ func IfToLower(s string) string {
46
if !hasUpper {
47
return s
48
}
49
- res := make([]byte, len(s))
50
- copy(res, s)
51
- for i := 0; i < len(res); i++ {
52
- res[i] = toLowerTable[res[i]]
53
- }
54
-
55
- return UnsafeString(res)
+ return ToLower(s)
56
57
58
// IfToUpper returns an uppercase version of the input ASCII string.
@@ -75,11 +69,5 @@ func IfToUpper(s string) string {
75
69
if !hasLower {
76
70
77
71
78
79
80
81
- res[i] = toUpperTable[res[i]]
82
83
84
72
+ return ToUpper(s)
85
73
0 commit comments