public static function slice($string, $start, $end = null)
    {
        if ($end !== null) {
            $end -= $start;
        }

        if (function_exists('mb_substr')) {
            return mb_substr($string, $start, $end, static::getEncoding());
        }

        if (function_exists('iconv_substr')) {
            return iconv_substr($string, $start, $end ?: iconv_strlen($string), static::getEncoding());
        }

        return false;
    }