wiki/content/20201116130210-truncate.md

20 lines
296 B
Markdown
Raw Permalink Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-16
2024-05-06 20:40:05 +00:00
id: b27eb467-5ff4-494f-aea4-85000152dda9
title: truncate()
---
- [Keep last word](20201116130327-keep_last_word)
# Description
Truncates string
# Syntax
``` php
use function Symfony\Component\String\u;
u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
```