> ## Documentation Index
> Fetch the complete documentation index at: https://reportana.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# length

### Introduction

The `length` filter is used to obtain the number of elements in a list or the number of characters in a string. It is useful for determining the size of arrays, objects, or strings, which can be essential for flow control and data formatting.

### Example of Use

Example of how to use the `length` filter to get the number of elements in a list and the number of characters in a string:

```twig theme={null}
{# Getting the number of elements in a list #}
{{ ['Apple', 'Banana', 'Orange']|length }}

{# Getting the number of characters in a string #}
{{ 'Hello, World!'|length }}
```

### Output Example of the Code

<img src="https://mintcdn.com/reportana/Jha6odPLZMMTun1e/length-en.png?fit=max&auto=format&n=Jha6odPLZMMTun1e&q=85&s=7c37a6427369c367bd32f68da1442f98" alt="Result of `length` Filter" width="853" height="280" data-path="length-en.png" />
