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