Feature Overview
JOIN() Join strings with a delimiter.
- Joins the argument strings with the specified delimiter.
- This function consumes 25 Token.
?join('====','----','----','----','----\n') ?join(' ',unpack({'test','[join]','is','ok!\n\n'})) ?join('\fa◆\f6','c','o','m','p','l','e','t','e\n') ?join('\-e=\-e',unpack(split('----------------------------',''))) |
This function is included in the KNUTIL library.
release note
P#59961 2022-09-10 15:45 ( Edited 2022-09-10 16:08)
I don't understand, can you give an example that behaves differently under the two implementations? this prints true 3 times
function join1(d,s,...) return not s and '' or not ... and s or s..d..join(d,...) end function join2(d,s,...) return ... and s..d..join(d,...) or s or '' end cls() ?join1()==join2() ?join1(" ")==join2(" ") ?join1(" ","hi")==join2(" ","hi") |
P#123615 2023-01-03 18:56
[Please log in to post a comment]