[Main page] [Overview]     /sefun /pretty_implode

SYNOPSIS
string pretty_implode( string *items, mixed alternative, string and, string comma)

FILE
/kernel/simul_efun/strings.h

DESCRIPTION
The function pretty_implode creates a list of 'items', concatenated by
default by ", " and " and ". If items is empty, 'alternative'
is returned. You can also change the default comma and the default
and-string.

EXAMPLES
write( pretty_implode( ({ "Cadellin","Warpi","Antihec" }))); will print
out: "Cadellin, Warpi and Antihec"

write( pretty_implode( foo, "nothing"));
will print the contents of foo, or if foo is empty, it will
return "nothing".

write( pretty_implode( ({ "Cadellin","Warpi","Antihec" }),0," and ","+"));
will result in: "Cadellin+Warpi and Antihec"

SEE ALSO
efun/implode