mirror of
https://github.com/alrayyes/wiki.git
synced 2024-12-01 15:26:23 +00:00
17 lines
307 B
Markdown
17 lines
307 B
Markdown
---
|
|
id: 5bb1ce24-7cdc-495f-b3d8-39f06f19e5bc
|
|
title: Keep last word
|
|
---
|
|
|
|
# Description
|
|
|
|
Keep last word when truncating.
|
|
|
|
# Syntax
|
|
|
|
``` php
|
|
use function Symfony\Component\String\u;
|
|
|
|
u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
|
|
u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum'
|
|
```
|