Str.join

From OpenEUO
Revision as of 18:06, 11 November 2010 by Ximan (Talk | contribs) (Created page with "== Calling Pattern == Call local r,c = sl.str.join(a1, a2[, ...]) Args a1...aN are of any type (converted to strings internally via tostring()) Results r is a string c is a n...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Calling Pattern

Call

local r,c = sl.str.join(a1, a2[, ...])

Args

a1...aN are of any type (converted to strings internally via tostring())

Results

r is a string
c is a number

Usage Example

local s = sl.str
local i = 'Bunch '
local r = s.join('Concatenate ', 'A ', i, 'Of ', 'Strings')
print(r)
--> Concatenate A Bunch Of Strings

Description

Joins all string arguments in order and returns the resultant string as well as the number of strings joined.

Upon Error

Join fails silently. If join receives no arguments, then a '' (empty string) is returned. If join receives only one argument, then that value is converted to a string and returned along with the arg count in the result tuple.

See Also