framework/db/SqlTokenizer.php
protected function substring($length, $caseSensitive = true, $offset = null)
    {
        if ($offset === null) {
            $offset = $this->offset;
        }
        if ($offset + $length > $this->length) {
            return '';
        }

        $cacheKey = $offset . ',' . $length;
        if (!isset($this->_substrings[$cacheKey . ',1'])) {
            $this->_substrings[$cacheKey . ',1'] = mb_substr($this->sql, $offset, $length, 'UTF-8');
        }
        if (!$caseSensitive && !isset($this->_substrings[$cacheKey . ',0'])) {
            $this->_substrings[$cacheKey . ',0'] = mb_strtoupper($this->_substrings[$cacheKey . ',1'], 'UTF-8');
        }

        return $this->_substrings[$cacheKey . ',' . (int) $caseSensitive];
    }
protected function substring($length, $caseSensitive = true, $offset = null)
    {
        if ($offset === null) {
            $offset = $this->offset;
        }
        if ($offset + $length > $this->length) {
            return '';
        }

        $cacheKey = $offset . ',' . $length;
        if (!isset($this->_substrings[$cacheKey . ',1'])) {
            $this->_substrings[$cacheKey . ',1'] = mb_substr($this->sql, $offset, $length, 'UTF-8');
        }
        if (!$caseSensitive && !isset($this->_substrings[$cacheKey . ',0'])) {
            $this->_substrings[$cacheKey . ',0'] = mb_strtoupper($this->_substrings[$cacheKey . ',1'], 'UTF-8');
        }

        return $this->_substrings[$cacheKey . ',' . (int) $caseSensitive];
    }
Returns a string of the given length starting with the specified offset.
@param int $length string length to be returned.
@param bool $caseSensitive if it's `false`, the string will be uppercased.
@param int|null $offset SQL code offset, defaults to current if `null` is passed.
@return string result string, it may be empty if there's nothing to return.