Difference between revisions of "Lua:byteTableToString"
Jump to navigation
Jump to search
(→Related Functions) |
m |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | '''function''' byteTableToString(''Table'') | + | [[Category:Lua]] |
+ | '''function''' byteTableToString(''Table'') ''':''' String | ||
− | Converts a | + | Converts a table of bytes to a string, where each byte represents the ASCII/ANSI value of the corresponding character. |
− | + | ===Function Parameters=== | |
− | === Function Parameters === | + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" |
− | {|width="85%" cellpadding="10 | ||
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
Line 11: | Line 11: | ||
|- | |- | ||
|Table | |Table | ||
− | | | + | |Table |
− | | | + | |A table containing the bytes to convert to a string. |
|} | |} | ||
+ | ===Returns=== | ||
+ | String — The resulting string formed from the byte values. | ||
− | == | + | ===Explanation=== |
− | + | 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, <code>byteTableToString({0x41, 0x42, 0x43})</code> returns <code>"ABC"</code>. | |
− | |||
+ | ===Examples=== | ||
+ | <pre> | ||
+ | local str = byteTableToString({0x41, 0x42, 0x43}) | ||
+ | print(str) -- Output: ABC | ||
+ | </pre> | ||
− | + | {{LuaSeeAlso}} | |
− | |||
− | |||
=== Related Functions === | === Related Functions === | ||
Line 34: | Line 35: | ||
* [[utf8ToAnsi]] | * [[utf8ToAnsi]] | ||
* [[translate]] | * [[translate]] | ||
− | + | {{ReadWriteMemory}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 17:41, 11 July 2025
function byteTableToString(Table) : String
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]
local str = byteTableToString({0x41, 0x42, 0x43}) print(str) -- Output: ABC
See also[edit]
Related Functions[edit]
- ansiToUtf8
- utf8ToAnsi
- translate
- readBytes
- readSmallInteger
- readInteger
- readQword
- readPointer
- readFloat
- readDouble
- readString
- writeBytes
- writeSmallInteger
- writeInteger
- writeQword
- writeFloat
- writeDouble
- writeString
- readBytesLocal
- readIntegerLocal
- readQwordLocal
- readPointerLocal
- readFloatLocal
- readDoubleLocal
- readStringLocal
- writeBytesLocal
- writeIntegerLocal
- writeQwordLocal
- writeFloatLocal
- writeDoubleLocal
- writeStringLocal
- wordToByteTable
- dwordToByteTable
- qwordToByteTable
- floatToByteTable
- doubleToByteTable
- stringToByteTable
- wideStringToByteTable
- byteTableToWord
- byteTableToDword
- byteTableToQword
- byteTableToFloat
- byteTableToDouble
- byteTableToString
- byteTableToWideString