Seek a position

@param mixed $position Position to seek.
@return Stringable
@throws OutOfBoundsException Invalid position.
507845
public function seek($position)
    {
        if (! isset($this->string[$position])) {
            throw new OutOfBoundsException("invalid seek position ($position)");
        }
        $this->position = $position;
        return $this;
    }
606978
public function getCharAt( $position )
	{
		if($position <= $this->count() && $position >= 0 )
			$character = $this->buffer[$position];
		return $character;
	}
1245888
private function getOutOfBoundsException($position = null)
    {
        return new OutOfBoundsException(
            sprintf('Invalid token position (%d)', $position !== null ? $position : $this->position)
        );
    }
851997
public function charAt($position)
    {
        if (isset($this->stringVar[$position])) {
            return $this->stringVar[$position];
        }
        return false;
    }
425500
public function seek($index)
	{
		$this->rewind();

		while ($this->_pos < $index && $this->valid())
		{
			$this->next();
		}

		if (!$this->valid())
		{
			throw new \OutOfBoundsException(\Lang::txt('Invalid seek position'));
		}
	}
1333250
public function getItem(int $position): ?APIItem
    {
        foreach ($this->items as $item) {
            if ($item->getPosition() === $position) {
                return $item;
            }
        }

        return null;
    }
380871
public function setAncor ( $position = null ) {
        if ( is_null($position) === true ) {
            $position = $this->_currentPosition;
        }
        $this->_ancorPosition = $position;
        return $this;
    }
259716
public function getTokenStringValueAt($tokenPosition)
    {
        if (!isset($this->tokens[$tokenPosition])) {
            throw new \OutOfBoundsException(sprintf('Token at offset %d does not exist', $tokenPosition));
        }

        $originalToken = $this->tokens[$tokenPosition];

        return is_string($originalToken) ? $originalToken : $originalToken[static::TOKEN_ORIGINAL_VALUE_OFFSET];
    }
361273
public function getNextEol($position = self::CURRENT_POSITION)
    {
        if (self::CURRENT_POSITION === $position) {
            $position = $this->position;
        }

        $eolPosition = strpos($this->data, "\n", $position);
        if (false === $eolPosition) {
            $eolPosition = strlen($this->data) - 1;
        }

        return $eolPosition;
    }
421953
public function peekTokenAt($position) {
		if ($position < count($this->tokens)) {
			return $this->tokens[$position];
		} else {
			return null;
		}
	}
163045
public function seek($position)
    {
        reset($this->_storage);
        while (($key = key($this->_storage)) !== null && $key !== $position)
        {
            next($this->_storage);
        }
    }
153482
public function setPosition($position)
	{
		if ( $position == $this->getPosition() ) { return; }

		$this->_values['pos'] = (int) $position;
		$this->setModified();
	}
158507
public function at(int $position): Utility
    {
        if ($position < 0) {
            return new static('', $this->encoding);
        }

        return $this->substring($position, 1);
    }
645439
public function gotoNextEol($position = self::CURRENT_POSITION)
    {
        if (self::CURRENT_POSITION === $position) {
            $position = $this->position;
        }
        $this->position = $this->getNextEol($position);
    }
420618
public function position(string $position): Log
    {
        $acceptablePositions = [
            'top right',
            'top left',
            'bottom right',
            'bottom left'
        ];

        if (array_search(strtolower($position), $acceptablePositions) === false) {
            $acceptablePositions = implode(', ', $acceptablePositions);
            throw new \Exception("position can only be: ${acceptablePositions}");
        }

        $this->position = $position;
        Alertify::flash();
        return $this;
    }
496251
public function set_seek_position($position)
    {
        $this->seek_position = isset($position) ? (integer)$position : null;

        return $this;
    }
1052213
public function skip(int $position): Pair
    {
        if ($position < 0 || $position >= count($this->pairs)) {
            throw new OutOfRangeException();
        }

        return $this->pairs[$position]->copy();
    }