From ComputerCraftJump to navigation Jump to search
Colon notation: str:byte()
Return the byte of the first character in the given str. As string literals in Lua represent ASCII strings, this will most likely return ASCII codepoints. To convert a byte back into a string, use string.char.
|Read a character from the user, then print the byte of each letter, separated by spaces.|
for character in read():gmatch(".") do write(string.byte(character)) write(" ") end
|Output||Depends on what the user wrote. For instance, if they were to enter
Retrieved from "https://wiki.computercraft.cc/index.php?title=String.byte&oldid=3830"