Skip to content Skip to footer navigation
🏰 Statamic Summit 2027 Feb 16–19 Talks, workshops, and three nights in a German castle. Get Tickets

First Modifier

Returns the first X characters of a string, where X is any positive integer, or the first item in an array.

title: 2015 Year Books Photos
array:
- Sonic
- Knuckles
- Tails
{{ title | first(4) }}
{{ array | first }}
{{ Statamic::modify($title)->first(4) }}
{{ Statamic::modify($array)->first() }}
2015
Sonic