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'