本地convert = string.char

时间:2018-09-19 04:51:10

标签: lua

此行的用途是什么。我是LUA编程char LUA的新手。

code=55
local convert=string.char(4,1,0,0,0,0,math.floor(224 + (code/16)), code % 16)
print(convert)

此处-string.character内部使用(4,1,0,0,0,0,0)的用途是什么。

1 个答案:

答案 0 :(得分:0)

The char function converts an ASCII-number to a string value, see lua string library.

string.char(i1, i2, ...)

Generate a string representing the character codes passed as arguments. Numerical codes are not necessarily portable across platforms.

> = string.char(65,66,67)
ABC
> = string.char()  -- empty string