Extracts keys from a CFML structure.
structKeyList(structure [, delimiter])
returns string
someStruct.keyList([delimiter])
Name | Type | Required | Default | Description |
---|---|---|---|---|
structure | struct | Yes | Structure from which to extract a list of keys | |
delimiter | string | No | , | Character that separates keys in list. Default: comma. |
Retrieve a pipe separated list of keys
statusCodes = {
OK = 200,
CREATED = 201,
NOT_MODIFIED = 304,
BAD_REQUEST = 400,
NOT_FOUND = 404
};
writeDump(structKeyList(statusCodes, " | "));
CF11+ Lucee4.5+ Retrieve a comma separated list of keys using the member function
statusCodes = {
OK = 200,
CREATED = 201,
NOT_MODIFIED = 304,
BAD_REQUEST = 400,
NOT_FOUND = 404
};
writeDump(statusCodes.keyList());