Splice portion of the underlying collection array.

@param  int    $offset
@param  int    $length
@param  mixed  $replacement
@return static
559374
public function splice($offset, $length = 0, $replacement = [])
		{
			return new static(array_splice($this->items, $offset, $length, $replacement));
		}
123753
public function slice($offset = 0, $length = null)
    {
        return $this->createSubCrawler(\array_slice($this->nodes, $offset, $length));
    }
1158605
public function getSlice($offset, $length)
    {
        $this->response = $this->searcher->search($offset, $length);
        $this->processResponse($this->response);

        return $this->hits;
    }
441391
public function replace($position, $length, $string)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		ArgumentValidator::validateUnsignedInteger($length);
		ArgumentValidator::validateScalar($string);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		if ($position + $length > $this->length()) {
			throw new \InvalidArgumentException('Length invalid');
		}
		$this->string = mb_substr($this->string, 0, $position) . (string)$string . mb_substr($this->string, $position + $length);
		return $this;
	}
633904
function splice_at( $i, array $nodes, $len = 0){
		$Child = $this->children[$i];
		$Child->pidx = null;
		$Child->depth = 0;
		array_splice( $this->children, $i, $len, $nodes );
		foreach( $nodes as $Node ){
			$Node->pidx = $this->idx;
		}
		$this->length = count( $this->children );
		$this->p = 0;
		return $Child;
	}
1364758
public function getSlice($offset, $length)
    {
        $query = clone $this->query;
        $query->offset = $offset;
        $query->limit = $length;
        $query->performCount = false;

        $searchResult = $this->filterService->filterLocations($query);

        // Set count for further use if returned by search engine despite !performCount (Solr, ES)
        if (!isset($this->nbResults) && isset($searchResult->totalCount)) {
            $this->nbResults = $searchResult->totalCount;
        }

        if (!isset($this->facets) && isset($searchResult->facets)) {
            $this->facets = $searchResult->facets;
        }

        $list = [];
        foreach ($searchResult->searchHits as $hit) {
            $list[] = $hit->valueObject;
        }

        return $list;
    }
937120
public function getSlice($offset, $length)
    {
        return $this->datasetFactory
            ->bookmarks()
            ->load($offset, $length)
            ->getBookmarks();
    }
274837
public function substr($str, $offset = 0, $length = null)
    {
        return iconv_substr($str, $offset, $length, $this->getEncoding());
    }
221031
public function slice($offset=0, $length=null)
    {
        $result = $this->createChildInstance();
        $result->nodes = \array_slice($this->nodes, $offset, $length);
        $result->length = \count($result->nodes);
        return $result;
    }
279521
protected function doWrite(string $data, int $offset, int $length)
    {
        $this->content = substr($this->content, 0, $offset)
                       . $data
                       . substr($this->content, $offset + $length);
    }
487394
protected function encodeLength(int $length, int $offset)
    {
        // if (!is_int($length) || !is_int($offset)) {
        //     throw new InvalidArgumentException('Length and offset must be int when call encodeLength.');
        // }
        if ($length < 56) {
            // var_dump($length, $offset);
            return new Buffer(strval($length + $offset));
        }
        $hexLength = $this->intToHex($length);
        $firstByte = $this->intToHex($offset + 55 + (strlen($hexLength) / 2));
        return new Buffer(strval($firstByte . $hexLength), 'hex');
    }
1227214
public function splice($offset, $length = null, $replacement = []): CollectionInterface
    {
        if (!is_iterable($replacement)) {
            $replacement = [$replacement];
        }

        return $this->wrap(function (Iterator $data) use ($offset, $length, $replacement) {
            // Handle offset
            while ($data->valid() && $offset) {
                yield $data->current();
                $data->next();
                $offset--;
            }

            // If we're given a null length, lets just remove the item at that point
            if ($length === null) {
                $length = 1;
            }

            // Skip $length
            while ($data->valid() && $length) {
                $data->next();
                $length--;
            }

            // Yield the replacements
            foreach ($replacement as $key => $item) {
                yield $item;
            }

            // Yield the remaining items
            while ($data->valid()) {
                yield $data->current();
                $data->next();
            }
        });
    }
623909
public function getSlice($offset, $length): NotificationList
    {
        $notifications = $this->notificationService->loadNotifications($offset, $length);

        if (null === $this->nbResults) {
            $this->nbResults = $notifications->totalCount;
        }

        return $notifications;
    }
1369995
public function truncate($value, $length, $replace = '...')
    {
        if (!isset($value)) {
            return null;
        }
        
        return strlen($value) <= $length ? $value : substr($value, 0, $length - strlen($replace)) . $replace;
    }
1033492
public function remove($startIndex, $length)
    {
        $start = UTF8::substr
        (
            (string)$this->str,
            0,
            $startIndex,
            $this->str->getEncoding()
        );

        $end = UTF8::substr
        (
            (string)$this->str,
            $startIndex + $length,
            $this->str->getLength(),
            $this->str->getEncoding()
        );

        $this->str = new Str($start.$end);

        return $this;
    }
418292
public function substr(int $offset, int $length = -1, bool $remove = false) {
        if ($this->swoole_buffer) {
            return $this->swoole_buffer->substr($offset, $length, $remove);
        }
        return null;
    }
390565
public function getSlice($offset, $length)
    {
        $list = array();
        foreach (parent::getSlice($offset, $length) as $hit) {
            $list[] = $hit->valueObject;
        }

        return $list;
    }