# 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`   |             |         |
| `delimiter` | `string` | `false`  |             | `,`     |

## Examples

### Using Custom Delimiter

Retrieve a pipe separated list of keys

[Run Example](https://try.boxlang.io/?code=eJwrLkksKS12zk9JLVawVahW4OL091awUjAyMNDh4nQOcnUMcXUB8w2BfD%2F%2FkHhffxdPN0%2BwoLGBCVDQydElPsg1MNQ1OAQoZgLWCFLo5h%2Fq5wIWMeGqteYqL8osSXUpzS3QUCguKSpNLvFOrfTJLC4BceFO0FFQUqgBYk0FTWsuADhoKX4%3D)

```java
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

[Run Example](https://try.boxlang.io/?code=eJwrLkksKS12zk9JLVawVahW4OL091awUjAyMNDh4nQOcnUMcXUB8w2BfD%2F%2FkHhffxdPN0%2BwoLGBCVDQydElPsg1MNQ1OAQoZgLWCFLo5h%2Fq5wIWMeGqteYqL8osSXUpzS3QUChG2KmXnVrpk1lcoqGpoGnNBQD98yWb)

```java
statusCodes = { 
	OK : 200,
	CREATED : 201,
	NOT_MODIFIED : 304,
	BAD_REQUEST : 400,
	NOT_FOUND : 404
};
writeDump( statusCodes.keyList() );

```

Result: "OK,CREATED,NOT\_MODIFIED,BAD\_REQUEST,NOT\_FOUND"

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxLzMvMTcwpVrBVqFbg4nT2D1ewUlDKzc9X0uHiDPB0B%2FHyM%2FOyQVxnxxCwZGp%2BOYjr5BnkAuInZ2QWFShx1Vpz6esrBJcUlSaXeKdW%2BmQWl2gkQgzX5IIwQGJAi1DVKEAVKWhac6UmZ%2BTDBMCKgWIAVPcwOQ%3D%3D)

```java
animals = { 
	COW : "moo",
	PIG : "oink",
	CAT : "meow",
	BIRD : "chirp"
};
// StructKeyList(animals)
animalList = StructKeyList( animals );
echo( animalList );

```

## Related

* [StructAppend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structappend)
* [StructClear](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structclear)
* [StructCopy](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structcopy)
* [StructDelete](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structdelete)
* [StructEach](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structeach)
* [StructEquals](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structequals)
* [StructEvery](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structevery)
* [StructFilter](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structfilter)
* [StructFind](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structfind)
* [StructFindKey](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structfindkey)
* [StructFindValue](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structfindvalue)
* [StructGet](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structget)
* [StructGetMetadata](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structgetmetadata)
* [StructInsert](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structinsert)
* [StructIsCaseSensitive](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structiscasesensitive)
* [StructIsOrdered](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structisordered)
* [StructKeyArray](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structkeyarray)
* [StructKeyExists](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structkeyexists)
* [StructKeyTranslate](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structkeytranslate)
* [StructMap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structmap)
* [StructNew](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structnew)
* [StructNone](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structnone)
* [StructReduce](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structreduce)
* [StructSome](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structsome)
* [StructSort](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structsort)
* [StructToQueryString](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structtoquerystring)
* [StructToSorted](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structtosorted)
* [StructUpdate](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structupdate)
* [StructValueArray](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structvaluearray)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structkeylist.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
