function toupper(ch) if (string.byte(ch) >= string.byte("a")) and (string.byte(ch) <= string.byte("z")) then return string.char(string.byte(ch) + string.byte("A") - string.byte("a")) else return ch end end function tolower(ch) if (string.byte(ch) >= string.byte("A")) and (string.byte(ch) <= string.byte("Z")) then return string.char(string.byte(ch) + string.byte("a") - string.byte("A")) else return ch end end function test(x) print(x .. " " .. toupper(x) .. " " .. tolower(x)) end test("a") test("A") test("m") test("M") test("z") test("Z") test("1") test(",")