commalist(
ARRAY
,
SEPARATOR
)

The commalist( function converts a text array (see Text Arrays) into an English list, with items separated by a comma and a space, except for the last two items which are separated by the word and and spaces.


Parameters

This function has two parameters:

array – the array containing the list of items.

separator – the separator character.


Description

This function converts a text array (see Text Arrays) into an English list, with items separated by a comma and a space, except for the last two items which are separated by the word and and spaces.

commalist("red/green/blue","/") ☞ red, green and blue
commalist("black-white","-") ☞ black and white
commalist("gold",",") ☞ gold

Note: This function is equivalent to:

?(thetext contains thesep,replace(arrayrange(thetext,1,-2,thesep)+
    " and "+array(thetext,-1,thesep),thesep,", "),thetext)

See Also


History

VersionStatusNotes
10.0NewNew in this version.