public static function truncate(string $s, int $maxLen, string $append = "\xE2\x80\xA6"): string
    {
        if (\mb_strlen($s) > $maxLen) {
            $maxLen -= \mb_strlen($append);
            if ($maxLen < 1) {
                return $append;
            }

            if ($matches = static::match($s, '#^.{1,' . $maxLen . '}(?=[\s\x00-/:-@\[-`{-~])#us')) {
                return $matches[0] . $append;
            }

            return \mb_substr($s, 0, $maxLen) . $append;
        }

        return $s;
    }