# ListValueCount

returns a count of the number of occurrences of a value in a list

## Method Signature

```
ListValueCount(list=[string], value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
```

### Arguments

| Argument                  | Type      | Required | Description                                   | Default |
| ------------------------- | --------- | -------- | --------------------------------------------- | ------- |
| `list`                    | `string`  | `true`   | The list to be searched.                      |         |
| `value`                   | `string`  | `true`   | The value to locale                           |         |
| `delimiter`               | `string`  | `false`  | The list delimiter(s)                         | `,`     |
| `includeEmptyFields`      | `boolean` | `false`  | Whether to include empty fields in the search | `false` |
| `multiCharacterDelimiter` | `boolean` | `false`  |                                               | `false` |

## Examples

### Simple Example

Counts instances of 'foo' in the list, ignoring case

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

```java
listValueCountNoCase( "foo,bar,lorem,Foo,ipsum", "foo" );

```

Result: 2

### Example with Custom Delimiter

Counts instances of 'foo' in the list with a custom delimiter, ignoring case

[Run Example](https://try.boxlang.io/?code=eJzLySwuCUvMKU11zi%2FNK%2FHLd04sTtVQUEpKLKpxy8%2BvyckvSs3VySwoLs2tyU2tScvP1ynOz00tycjMSwfxatz8%2FZV0FJSATBBVo6Sgac0FAFkAHeg%3D)

```java
listValueCountNoCase( "bar|Foo|lorem,ipsum|me|foo,something|foo|FOO", "foo", "|" );

```

Result: 3

### Additional Examples

[Run Example](https://try.boxlang.io?code=eJyVj0ELgkAQRu%2F%2BisFLCguCVwnWzEKQukR4XWWIBVtjd7b8%2BU2U5SWo07y5PL5Xa0ewhLAdxl6Zk8iLjXhxOdKEApCf1b6p8922bA5hFtysJlz78yWCmh1H1XssBm8ogp5%2F8VaGEEOcQZJARWCRvDULB%2BnvAt7xxQEtdso7BE3QKb6VcWicJn3F4CFNZ2mS0%2BRHOaHkMvlPWTpLY5TPbXc%2BE2xh)

```java
List = "boxlang,ACF,boxlangExt,boxlang, ext,BOXLANGEXT";
writeDump( ListValueCount( list, "boxlang" ) ); // It return's 2
writeDump( ListValueCount( list, "boxlangExt" ) ); // It return's 2 because it case Insensitive
List2 = "boxlang@ACF@boxlangExt@boxlang@ext@BOXLANGEXT";
writeDump( ListValueCount( list2, "boxlang", "@" ) );

```

## 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)
* [ListGetAt](/boxlang-language/reference/built-in-functions/list/listgetat.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)
* [ListValueCountNoCase](/boxlang-language/reference/built-in-functions/list/listvaluecountnocase.md)


---

# 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/list/listvaluecount.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.
