src/Helpers/Request/StringHelper.php
public function truncate($string, $length, $suffix = '...', $encoding = null, $asHtml = false)
    {
        return $this->proxyWithCharset(__FUNCTION__, [$string, $length, $suffix, $encoding, $asHtml], -2);
    }
public function truncate($string, $length, $suffix = '...', $encoding = null, $asHtml = false)
    {
        return $this->proxyWithCharset(__FUNCTION__, [$string, $length, $suffix, $encoding, $asHtml], -2);
    }
Truncates a string to the number of characters specified.

@param string $string The string to truncate.
@param int $length How many characters from original string to include into truncated string.
@param string $suffix String to append to the end of truncated string.
@param string $encoding The charset to use, defaults to charset currently used by application.
@param bool $asHtml Whether to treat the string being truncated as HTML and preserve proper HTML tags.
@return string the truncated string.
@see \Reaction\Helpers\StringHelper::truncate()