![]() | |||||||||
| |||||||||
Lua-ApiString |
[LUA 5.1] string.bytefunction string.byte ( s, i, j )
Returns the internal numerical codes of the characters s[i], s[i+1], ···, s[j]. (Defaults: i=1, j=i) Code print(string.byte("ABCD",2,2)) -- 66 If i or j is negative, it counts the characters from last character backwards. Code print(string.byte("ABCD",-2,-2)) -- 67 Note: Numerical codes are not necessarily portable across platforms. i and j are optional parameters. If except the s no parameter is given, i is set to 1 and j, too. Code print(string.byte("ABCD")) -- 65 If except the s and a second parameter is given, i and j are set to the value of the second parameter. Code print(string.byte("ABCD",3)) -- 67 See the function string.char for converting the internal numerical code of characters back to strings. Comments |
||||||||
| © 2007 DracoBlue :: Valid XHTML, CSS, RSS Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC | SourceNet © 2007, DracoBlue :: Page created in 0.257 seconds with 52 queries. | |||||||||