Difference between revisions of "Table.concat"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ··· sep...") |
|||
Line 4: | Line 4: | ||
Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ··· sep..table[j]. The default value for sep is the empty string, the default for i is 1, and the default for j is the length of the table. If i is greater than j, returns the empty string. | Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ··· sep..table[j]. The default value for sep is the empty string, the default for i is 1, and the default for j is the length of the table. If i is greater than j, returns the empty string. | ||
<source lang="lua"> | <source lang="lua"> | ||
− | (string) | + | (string) = table.concat(table,sep,i,j) |
</source> | </source> | ||
− | '''table | + | '''table''': (table) table of values to concatenate ''''''<br/> |
− | '''sep | + | '''sep''': (string) separator what to insert between table elements '''optional'''<br/> |
− | '''i | + | '''i''': (number) concatenate from this element (default is 1) '''optional'''<br/> |
− | '''j | + | '''j''': (number) concatenate until this element (default is table length) '''optional'''<br/> |
'''Returns''' (string) concatenated string<br/> | '''Returns''' (string) concatenated string<br/> |
Revision as of 10:16, 23 August 2018
Available since: Gideros 2011.6
Description
Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ··· sep..table[j]. The default value for sep is the empty string, the default for i is 1, and the default for j is the length of the table. If i is greater than j, returns the empty string.
(string) = table.concat(table,sep,i,j)
'table: (table) table of values to concatenate '
sep: (string) separator what to insert between table elements optional
i: (number) concatenate from this element (default is 1) optional
j: (number) concatenate until this element (default is table length) optional
Returns (string) concatenated string