|
|
|
@ -2,7 +2,6 @@ package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"slices"
|
|
|
|
|
"strings"
|
|
|
|
|
"unicode"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -159,17 +158,3 @@ func replaceByValue[T comparable](slc []T, toReplace T, replaceWith T) []T {
|
|
|
|
|
}
|
|
|
|
|
return slc
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// swapCase swaps the case of every character in the given string, and returns
|
|
|
|
|
// the new string.
|
|
|
|
|
func swapCase(str string) string {
|
|
|
|
|
return strings.Map(func(r rune) rune {
|
|
|
|
|
switch {
|
|
|
|
|
case unicode.IsLower(r):
|
|
|
|
|
return unicode.ToUpper(r)
|
|
|
|
|
case unicode.IsUpper(r):
|
|
|
|
|
return unicode.ToLower(r)
|
|
|
|
|
}
|
|
|
|
|
return r
|
|
|
|
|
}, str)
|
|
|
|
|
}
|
|
|
|
|