Cuts off a piece of a string based on character indices and counts.
$text: The input string.
$start: The position at which to start reading.
$length: The number of characters to read.
The shortened string.
\Drupal\Component\Utility\Unicode::substr().
function drupal_substr($text, $start, $length = NULL) {
return Unicode::substr($text, $start, $length);
}