> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listgetat.md).

# ListGetAt

Retrieves an item from a delimited list at the specified position

## Method Signature

```
ListGetAt(list=[string], position=[integer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
```

### Arguments

| Argument                  | Type      | Required | Description                                                    | Default |
| ------------------------- | --------- | -------- | -------------------------------------------------------------- | ------- |
| `list`                    | `string`  | `true`   | string list to filter entries from                             |         |
| `position`                | `integer` | `true`   | numeric the one-based index position to retrieve the value at  |         |
| `delimiter`               | `string`  | `false`  | string the list delimiter                                      | `,`     |
| `includeEmptyFields`      | `boolean` | `false`  | boolean whether to include empty fields in the returned result | `false` |
| `multiCharacterDelimiter` | `boolean` | `false`  | boolean whether the delimiter is multi-character               | `false` |

## Examples

### Simple Example

Returns the 2nd element in the list

[Run Example](https://try.boxlang.io/?code=eJzLySwucU8tcSzRUFBKy8%2FXSUos0snJL0rN1cksKC7NVdJRMFLQtOYCABBIDHQ%3D)

```java
listGetAt( "foo,bar,lorem,ipsum", 2 );

```

Result: bar

### Example with Delimiter

Returns the 3rd element in the list using a custom delimiter

[Run Example](https://try.boxlang.io/?code=eJzLySwucU8tcSzRUFBKy8%2FXSUosqsnJL0rN1cksKC7NrclNrSnOz00tycjMS1fSUTDWUVCqUVLQtOYCAGHmE2k%3D)

```java
listGetAt( "foo,bar|lorem,ipsum|me|something", 3, "|" );

```

Result: me

### Example with IncludeEmptyValues

Returns the 4th element in the list, treating the empty element as a value

[Run Example](https://try.boxlang.io/?code=eJzLySwucU8tcSzRUFBKy8%2FXSUos0tHJyS9KzdXJLCguzVXSUTDRUVDSAdIlRaWpCprWXAC3TA9q)

```java
listGetAt( "foo,bar,,lorem,ipsum", 4, ",", true );

```

Result: lorem

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxNzrsKwzAMBdDdX3HxkgRMNZROoUOhj6Wl0D%2BIbUENeWHLpJ9fp3TIJAkuOneJQfiZZc5Sow9JbiynsurOGGuc0QZ7A71OiZnRoGlBhBdLjmOCVeV48GA54ppHJ2EasQR5o6IKnvswFCCqJPFevuMITR2RJUfkdauW1T%2FnYa7xj%2Bw2LQ6Fpi2tVvvymdkJe0y%2F3nDqC4%2BwPHA%3D)

```java
writeOutput( listGetAt( "a,,b,c,", 3, ",", true ) ); // Returns b
// Member Function with '/' delimiter
strList = "/a//b/c//d";
writeDump( strList.listGetAt( 5, "/", true ) );
 // Expected output c

```

## Related

* [GetToken](/boxlang-language/reference/built-in-functions/list/gettoken.md)
* [ListAppend](/boxlang-language/reference/built-in-functions/list/listappend.md)
* [ListAvg](/boxlang-language/reference/built-in-functions/list/listavg.md)
* [ListChangeDelims](/boxlang-language/reference/built-in-functions/list/listchangedelims.md)
* [ListCompact](/boxlang-language/reference/built-in-functions/list/listcompact.md)
* [ListContains](/boxlang-language/reference/built-in-functions/list/listcontains.md)
* [ListContainsNoCase](/boxlang-language/reference/built-in-functions/list/listcontainsnocase.md)
* [ListDeleteAt](/boxlang-language/reference/built-in-functions/list/listdeleteat.md)
* [ListEach](/boxlang-language/reference/built-in-functions/list/listeach.md)
* [ListEvery](/boxlang-language/reference/built-in-functions/list/listevery.md)
* [ListFilter](/boxlang-language/reference/built-in-functions/list/listfilter.md)
* [ListFind](/boxlang-language/reference/built-in-functions/list/listfind.md)
* [ListFindNoCase](/boxlang-language/reference/built-in-functions/list/listfindnocase.md)
* [ListFirst](/boxlang-language/reference/built-in-functions/list/listfirst.md)
* [ListGetEndings](/boxlang-language/reference/built-in-functions/list/listgetendings.md)
* [ListIndexExists](/boxlang-language/reference/built-in-functions/list/listindexexists.md)
* [ListInsertAt](/boxlang-language/reference/built-in-functions/list/listinsertat.md)
* [ListItemTrim](/boxlang-language/reference/built-in-functions/list/listitemtrim.md)
* [ListLast](/boxlang-language/reference/built-in-functions/list/listlast.md)
* [ListLen](/boxlang-language/reference/built-in-functions/list/listlen.md)
* [ListMap](/boxlang-language/reference/built-in-functions/list/listmap.md)
* [ListNone](/boxlang-language/reference/built-in-functions/list/listnone.md)
* [ListPrepend](/boxlang-language/reference/built-in-functions/list/listprepend.md)
* [ListQualify](/boxlang-language/reference/built-in-functions/list/listqualify.md)
* [ListReduceRight](/boxlang-language/reference/built-in-functions/list/listreduceright.md)
* [ListRemoveDuplicates](/boxlang-language/reference/built-in-functions/list/listremoveduplicates.md)
* [ListRest](/boxlang-language/reference/built-in-functions/list/listrest.md)
* [ListSetAt](/boxlang-language/reference/built-in-functions/list/listsetat.md)
* [ListSome](/boxlang-language/reference/built-in-functions/list/listsome.md)
* [ListSort](/boxlang-language/reference/built-in-functions/list/listsort.md)
* [ListToArray](/boxlang-language/reference/built-in-functions/list/listtoarray.md)
* [ListTrim](/boxlang-language/reference/built-in-functions/list/listtrim.md)
* [ListValueCount](/boxlang-language/reference/built-in-functions/list/listvaluecount.md)
* [ListValueCountNoCase](/boxlang-language/reference/built-in-functions/list/listvaluecountnocase.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listgetat.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
