Inserts the given string at the given position

@param int $position
@param string $string
@return $this
@throws \InvalidArgumentException
9557
public function insert($position, $string)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		ArgumentValidator::validateScalar($string);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		$this->string = mb_substr($this->string, 0, $position) . (string)$string . mb_substr($this->string, $position);
		return $this;
	}
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;
    }
1326463
public function addProperty($property, $content, $position = 100)
    {
        $attr = [
            'property' => $property,
            'content' => $content
        ];
        $this->add($attr, $position);
        return $this;
    }
728151
private function array_insert(mixed $object, string $key, int $position) : void
    {
        if (0 == count($this->members)) {
            // The array is empty so just add the item
            $this->members[$key] = $object;
        } elseif ($position == count($this->members)) {
            // The item goes at the end of the array
            $this->members[$key] = $object;
        } else {
            $this->members = array_slice($this->members, 0, $position,
                    true) + array($key => $object) + array_slice($this->members, $position, null, true);
        }
    }
1106331
public function deleteCharAt($position)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		$this->string = mb_substr($this->string, 0, $position) . mb_substr($this->string, $position + 1);
		return $this;
	}
496251
public function set_seek_position($position)
    {
        $this->seek_position = isset($position) ? (integer)$position : null;

        return $this;
    }
1081812
public function charAt($position)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		return mb_substr($this->string, $position, 1);
	}
1307962
public function addString($key, $string)
    {
        $this->strings[$this->normalize($key)] = $string;

        return $this;
    }
500773
public function prependF ($string)
	{
		ensure('Argument', $string, 'is_a_string', __CLASS__, __METHOD__);

		if ($string instanceof self) {
			$string = $string->to_s();
		}

		$this->string = $string . $this->string;

		return $this;
	}
976249
protected function checkSaltPositionArgument($position): void
    {
        if (!in_array($position, [self::SALT_BEFORE, self::SALT_AFTER])) {
            throw new InvalidArgumentException(sprintf(
                '`%s` is an invalud argument, it has to be `` or ``',
                $position,
                self::SALT_BEFORE,
                self::SALT_AFTER
            ));
        }
    }
1093636
function setPosition(int $position, string $reason = '') {
        if($position < 0) {
            throw new \InvalidArgumentException('Position can not be below 0');
        }
        
        $newPositions = array();
        $newPositions[] = array('id' => $this->id, 'position' => $position);
        
        $count = $this->guild->channels->count();
        $channels = $this->guild->channels->sortCustom(function ($a, $b) {
            if($a->position === $b->position) {
                return $a->id <=> $b->id;
            }
            
            return $a->position <=> $b->position;
        })->values()->all();
        
        $pos = 0;
        for($i = 0; $i < $count; $i++) {
            if($pos === $position) {
                $pos++;
            }
            
            $channel = $channels[$i];
            
            if($pos === $channel->position) {
                continue;
            }
            
            $newPositions[] = array('id' => $channel, 'position' => $pos);
            $pos++;
        }
        
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($newPositions, $reason) {
            $this->client->apimanager()->endpoints->guild->modifyGuildChannelPositions($this->guild->id, $newPositions, $reason)->done(function () use ($resolve) {
                $resolve($this);
            }, $reject);
        }));
    }
719049
public function insert( $offset , $string )
	{
		$this->buffer = substr( $this->buffer , 0 , $offset ) . $string . substr( $this->buffer , $offset );
		return $this;
	}
1353705
public function getStringPositionSql($substring, $string)
	{
		$this->connect();

		$query = "SELECT POSITION( $substring IN $string )";
		$this->setQuery($query);
		$position = $this->loadRow();

		return $position['position'];
	}
456489
public function insert(string $string) {
        $node = $this->root;
        for ($i = 0; $i < \strlen($string); $i++) {
            $charIndex = $this->getCharIndex($string[$i]);
            if (!$node->hasChild($charIndex)) {
                $node->createChildNode($charIndex);
            }
            $node = $node->getChildNode($charIndex);
        }
        $node->createEndOfWordNode();
    }
1144819
def insert_text(self, string):
        """
        self.l_buffer.insert_text(string, self.argument_reset)
        self.finalize()
1177765
public function startsWith($searchString, $position = 0)
    {
        return $this->substr($position, strlen($searchString))->value() === $searchString;
    }
132270
public function prepend($string)
    {
        $this->value = Character::ensureLeading($string, $this->value);

        return $this;
    }