string.byte
Lua function string.byte Summary Converts a character into its ASCII (decimal) equivalent Prototype `code = string.byte (s, n)` Description `Returns the ASCII code for the nth character of the string s. The inverse operation is carried out by string.char. Default for n is 1.
    print (string.byte ("ABC")) --> 65 (A is 65 in ASCII)
    print (string.byte ("ABC", 2)) --> 66 (B is 66)
` See Also ... Topics Lua base functions Lua bc (big number) functions Lua bit manipulation functions Lua coroutine functions Lua debug functions Lua io functions Lua math functions Lua os functions Lua package functions Lua PCRE regular expression functions Lua script extensions Lua string functions Lua table functions Lua utilities Regular Expressions Scripting Lua functions string.char (Converts ASCII codes into their equivalent characters) string.dump (Converts a function into binary) string.find (Searches a string for a pattern) string.format (Formats a string) string.gfind (Iterate over a string (obsolete in Lua 5.1)) string.gmatch (Iterate over a string) string.gsub (Substitute strings inside another string) string.len (Return the length of a string) string.lower (Converts a string to lower-case) string.match (Searches a string for a pattern) string.rep (Returns repeated copies of a string) string.reverse (Reverses the order of characters in a string) string.sub (Returns a substring of a string) string.upper (Converts a string to upper-case) (Help topic: lua=string.byte) Documentation contents page