function Helper::substr
Returns the subset of a string, using mb_substr if it is available.
4 calls to Helper::substr()
- Application::find in vendor/
symfony/ console/ Application.php - Finds a command by name or alias.
- FormatterHelper::truncate in vendor/
symfony/ console/ Helper/ FormatterHelper.php - Truncates a message to the given length.
- QuestionHelper::autocomplete in vendor/
symfony/ console/ Helper/ QuestionHelper.php - Autocompletes a question.
- Table::renderRowSeparator in vendor/
symfony/ console/ Helper/ Table.php - Renders horizontal header separator.
File
-
vendor/
symfony/ console/ Helper/ Helper.php, line 77
Class
- Helper
- Helper is the base class for all helper classes.
Namespace
Symfony\Component\Console\HelperCode
public static function substr(?string $string, int $from, ?int $length = null) : string {
$string ??= '';
if (false === ($encoding = mb_detect_encoding($string, null, true))) {
return substr($string, $from, $length);
}
return mb_substr($string, $from, $length, $encoding);
}