Sets the character at the given position

@param int $position
@param string $character
@return $this
@throws \InvalidArgumentException
961799
public function setCharAt($position, $character)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		ArgumentValidator::validateScalar($character);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		if (mb_strlen((string)$character) !== 1) {
			throw new \InvalidArgumentException('Expected a scalar value of length 1');
		}
		$this->string = mb_substr($this->string, 0, $position) . (string)$character . mb_substr($this->string, $position + 1);
		return $this;
	}
1152097
def set_char( at , char )
      raise "char not fixnum #{char.class}" unless char.kind_of? ::Integer
      index = range_correct_index(at)
      set_internal_byte( index , char)
    end
1097197
public function setPointer($charOffset)
    {
        if ($this->charCount < $charOffset) {
            $charOffset = $this->charCount;
        }
        $this->currentPos = $charOffset;
    }
240265
public function setIconPosition($iconPosition)
    {
        switch ($iconPosition) {
            case self::ICON_PREPEND:
            case self::ICON_APPEND:
                $this->iconPosition = $iconPosition;
                break;
            default:
                throw new Exception\InvalidArgumentException('Invalid icon position given');
        }
        return $this;
    }
485062
public CharacterHit offset(int offsetAmount) {
        return new CharacterHit(
                charIdx.isPresent()
                        ? OptionalInt.of(charIdx.getAsInt() + offsetAmount)
                        : charIdx,
                insertionIndex + offsetAmount);
    }
212172
public function setLocation($location)
    {
        if (! is_int($location)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be an int value. Valued passed is of type ' . gettype($location));
        }
        
        $this->location = $location;
    }
160492
public function insertAt($position = null)
    {
        if (null === $position) {
            $position = $this->listifyTop();
        }

        $this->insertAtPositionAndReorder($position);

        return $this;
    }
950056
public function insert($position, $str)
    {
        $string = (string)$str;

        $string = substr_replace($this->text, $string, $position, 0);

        return new MString($string);
    }
851997
public function charAt($position)
    {
        if (isset($this->stringVar[$position])) {
            return $this->stringVar[$position];
        }
        return false;
    }
767020
public static function set($position, $value, $baseOn = null) {
        $t = pow(2, $position - 1);
        if($value) {
            $t = $baseOn | $t;
        } elseif ($baseOn !== null) {
            $t = $baseOn & ~$t;
        } else {
            $t = ~$t;
        }
        return $t & 0xFFFF;
    }
1081812
public function charAt($position)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		return mb_substr($this->string, $position, 1);
	}
1043294
public function setCyclePosition($position)
    {
        if ($position >= $this->count()) {
            $this->cyclePosition = $this->count() - 1;
        } elseif ($position < 0) {
            $this->cyclePosition = 0;
        } else {
            $this->cyclePosition = (int)$position;
        }
        return $this;
    }
606978
public function getCharAt( $position )
	{
		if($position <= $this->count() && $position >= 0 )
			$character = $this->buffer[$position];
		return $character;
	}
540840
private function setMes(int $mes, int $position)
    {
        if (!$this->certeza['mes']) {
            if (isset($this->data['mes'])) {
                $current = $this->setDateInfo('dia', 'ano');
                if ($current) {
                    $this->data[$current] = $this->data['mes'];
                    $this->position[$current] = $this->position['mes'];
                }
            }
            $this->data['mes'] = $mes;
            $this->certeza['mes'] = true;
            $this->position['mes'] = $position;
        }
    }
177725
public function add($char, $expr)
	{
		$split = $this->input->split($char);
		if (count($split) !== 1)
		{
			throw new InvalidArgumentException('Meta-characters must be represented by exactly one character');
		}
		if (@preg_match('(' . $expr . ')u', '') === false)
		{
			throw new InvalidArgumentException("Invalid expression '" . $expr . "'");
		}

		$inputValue = $split[0];
		$metaValue  = $this->computeValue($expr);

		$this->exprs[$metaValue] = $expr;
		$this->meta[$inputValue] = $metaValue;
	}
1258575
public function addMenuItem(MenuItem $menuItem, $position = -1) {
        if (!is_int($position)) {
            throw new InvalidArgumentException('position should be of type int.');
        }

        if ($position < 0) {
            $position = count($this->menuItems);
        }

        $menuItem->setOrder($position);

        Utils::array_insert($this->menuItems, $menuItem, $position);

        return $this;
    }
161402
public function setColor(string $color): self
    {
        if (!preg_match("/^#([A-Fa-f0-9]{6})$/", $color)) {
            throw new \InvalidArgumentException($color. " is not a valid hexadecimal color");
        }
        $this->color = $color;
        return $this;
    }