StructKeyList
Get keys of a struct as a string list
Method Signature
StructKeyList(structure=[structloose], delimiter=[string])Arguments
Argument
Type
Required
Description
Default
structure
struct
true
The struct whose keys are returned.
delimiter
string
false
The delimiter to use between the keys in the returned list. Defaults to a comma.
,
Examples
Using Custom 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, " | " ) );
Result: "OK | CREATED | NOT_MODIFIED | BAD_REQUEST | NOT_FOUND"
Using Member Function
Retrieve a comma separated list of keys using the member function
Result: "OK,CREATED,NOT_MODIFIED,BAD_REQUEST,NOT_FOUND"
Additional Examples
Related
Last updated
Was this helpful?
