listCompact

Remove empty elements from start and end of the list

listCompact(list [, delimiters] [, multiCharacterDelimiter]) → returns string

Member Function Syntax

list.listCompact([delimiters] [, multiCharacterDelimiter])

This function requires Lucee. Not supported on Adobe ColdFusion.

listCompact Argument Reference

list string
Required

delimiters string
Default: ,

multiCharacterDelimiter boolean
Default: false

Examples sample code invoking the listCompact function


Trims first and last comma from list string

listCompact(",eggs,milk,bread,flour,")

Expected Result: eggs,milk,bread,flour


Fork me on GitHub