gather

Concatenate multiple texts in one string with a delimiter

Parameters description

ParameterTypeDescriptionDefault

texts

string[]

the texts to gather

---

delimiter

string?

the delimiter between the texts in the gathered one

a space

Example

local texts = {
    'test1',
    'test2',
    'test3'
}

local gatheredText = HRLib.string.gather(texts, '|')
print(gatheredText) -- Output: test1|test2|test3

Last updated