concat

Concatenates array elements into a string with a specified separator.

Parameters:

  • tab (table): Array of values to concatenate

  • str (string): Separator string to join elements

Returns:

  • result (string): Concatenated string

Example:

-- Join player names
local players = {"John", "Jane", "Bob"}
local playerList = ps.concat(players, ", ")
-- Result: "John, Jane, Bob"

-- Create file path
local pathParts = {"resources", "ps_lib", "modules", "misc"}
local fullPath = ps.concat(pathParts, "/")
-- Result: "resources/ps_lib/scripts/ps-lib/modules/misc"

-- Format coordinates
local coords = {100.5, 200.3, 30.1}
local coordString = ps.concat(coords, ", ")
-- Result: "100.5, 200.3, 30.1"

Last updated