Extracts keys from a CFML structure.
structKeyList(structure [, delimiter])
→ returns string
someStruct.keyList([delimiter])
,
Retrieve a pipe separated list of keys
statusCodes = {
OK = 200,
CREATED = 201,
NOT_MODIFIED = 304,
BAD_REQUEST = 400,
NOT_FOUND = 404
};
writeDump(structKeyList(statusCodes, " | "));
Expected Result: "OK | CREATED | NOT_MODIFIED | BAD_REQUEST | NOT_FOUND"
CF 11+ Lucee 4.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());
Expected Result: "OK,CREATED,NOT_MODIFIED,BAD_REQUEST,NOT_FOUND"
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.