Difference between revisions of "Lua:byteTableToString"
Jump to navigation
Jump to search
m |
m (Syntax Highlighting.) |
||
| Line 24: | Line 24: | ||
===Examples=== | ===Examples=== | ||
| − | < | + | <syntaxhighlight lang="lua" line> |
local str = byteTableToString({0x41, 0x42, 0x43}) | local str = byteTableToString({0x41, 0x42, 0x43}) | ||
print(str) -- Output: ABC | print(str) -- Output: ABC | ||
| − | </ | + | </syntaxhighlight> |
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
Latest revision as of 15:49, 25 June 2026
Converts a table of bytes to a string, where each byte represents the ASCII/ANSI value of the corresponding character.
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| Table | Table | A table containing the bytes to convert to a string. |
Returns[edit]
String — The resulting string formed from the byte values.
Explanation[edit]
Each element in the table is interpreted as a character code (byte), and the resulting string is constructed by concatenating these characters in order.
For example, byteTableToString({0x41, 0x42, 0x43}) returns "ABC".
Examples[edit]
1 local str = byteTableToString({0x41, 0x42, 0x43})
2 print(str) -- Output: ABC