We have to use the below syntax if we need to truncate the string from .phtml file
1 2 3 4 |
<?php $length = 10; ?> <?php $string = new \Magento\Framework\Stdlib\StringUtils;?> <?php echo $string->substr($data->getContent(),0,$length); ?> |