0101~0110
0111~0120
0121~0130
0131~0140
0141~0150
/**
* @param character: a character
* @return: a character
*/
func LowercaseToUppercase(character byte) byte {
// write your code here
character -= 32
return character
}
/**
* @param letters: A string
* @return: A string
*/
import "strings"
func LowercaseToUppercase2(letters string) string {
// write your code here
return strings.ToUpper(letters)
}
/**
* @param letters: A string
* @return: A string
*/
func LowercaseToUppercase2(letters string) string {
// 65 - 90 A-Z
// 97 - 122 a-z
sp := []byte(letters)
for i, v := range sp {
if v >= 97 && v <= 122 {
sp[i] = byte(v - 32)
}
}
return string(sp)
}