Logo

Programming-Idioms

History of Idiom 53 > diff from v27 to v28

Edit summary for version 28 by :
New Lua implementation by user [jparoz]

Version 27

2016-01-03, 06:40:39

Version 28

2016-02-16, 16:34:38

Idiom #53 Join a list of strings

Concatenate elements of string list x joined by the separator ", " to create a single string y.

Idiom #53 Join a list of strings

Concatenate elements of string list x joined by the separator ", " to create a single string y.

Code
for _, v in ipairs(x) do
	if y then
		y = y .. ', ' .. v
	else
		y = v
	end
end