Whatever message this page gives is out now! Go check it out!
setToList(set)
set.toList()| Parameter | Description |
|---|---|
| set | Set to convert. |
| delimiter | The delimiter to appear in the output. |
cfscript (syntax: setToList(set)).
<cfscript>
s = setNew();
s.add("one");
s.add("two");
s.add("three");
listForm = setToList(s,";");
writeOutput(listForm); // e.g. "one;two;three"
</cfscript>
<cfscript>
function categoryListForTag(required any categorySet) {
return setToList(categorySet, ",");
}
cats = setNew();
cats.add("news");
cats.add("sports");
// Hypothetical: <cfmodule categories="#categoryListForTag(cats)#">
writeOutput(categoryListForTag(cats));
</cfscript>