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

# slice

### Introduction

The `slice` filter is used to extract a portion of a string, array, or other sequence type. It allows you to select a subset of elements or characters by specifying the starting point and the number of elements you want to extract.

### Example of Use

Example of how to use the `slice` filter to get the first three characters of a string:

```twig theme={null}
{% set text = 'Reportana' %}
{% set sliced_text = text|slice(0, 3) %}
{{ sliced_text }}
```

### Output Example of the Code

<img src="https://mintcdn.com/reportana/rrUbVfAgCraOJwnY/slice-en.png?fit=max&auto=format&n=rrUbVfAgCraOJwnY&q=85&s=ea936a654cfa9d804c1dfa2b6f3d2feb" alt="Result of `slice` Filter" width="137" height="70" data-path="slice-en.png" />
