Log In  

Cart #concat___table-0 | 2022-03-11 | Code ▽ | Embed ▽ | No License

Feature Overview

CAT() concatenates two or more tables.

  • The second and subsequent arguments are added to the table elements of the first argument.
  • Returns a concatenated table.
  • The table used for the first argument is updated. (destructive)
  • This function consumes 39 Token.
local tbl_1 = {'a'}
local tbl_2 = {'b', 'c'}

cat(tbl_1, tbl_2)

?tbl_1[1]
?tbl_1[2]
?tbl_1[3]

-- Only primary elements can be cloned.
local tbl = {1, 2, 3}
local tbl_dup = cat({}, tbl)
tbl[1] = 256

?tbl_dup[1]
?tbl_dup[2]
?tbl_dup[3]

See the code in the cartridge for further examples.

may want to Use VDMP() if check the converted table.
This function is included in the KNUTIL library.

P#88288 2022-03-11 14:12 ( Edited 2022-03-21 09:09)


[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2022-05-04 14:55:15 | 0.007s | Q:13