Returns a new string with a given string inserted at a given index
@param int $index
@param self $str
@return \static
760324
public function insert($index, self $str){
		
		if(!$this->offsetExists($index)){
			throw new \OutOfRangeException('$index is invalid');
		}
		
		return new static(
				$this->substring(0, $index) .
				$str->_Value .
				$this->substring($index),
			$this->_Encoding);
		
	}
1256889
public function newInstance($index)
    {
        $id = strtolower($index);
        if (!isset(static::$indexList[get_called_class()][$id])) {
            throw new \RuntimeException('No FileRequest found for: ' . $id);
        }
        $class = static::$indexList[get_called_class()][$id];
        return new $class;
    }
893783
public static function fromString(string $str): self
    {
        if (!preg_match(self::PEM_REGEX, $str, $match)) {
            throw new \UnexpectedValueException("Not a PEM formatted string.");
        }
        $payload = preg_replace('/\s+/', "", $match[2]);
        $data = base64_decode($payload, true);
        if (false === $data) {
            throw new \UnexpectedValueException("Failed to decode PEM data.");
        }
        return new self($match[1], $data);
    }
733126
protected function doInsertStringBeforePosition(string $string, string $insertStr, int $position): string
    {
        return \substr($string, 0, $position) . $insertStr . \substr($string, $position);
    }
1201026
public function getLineString($index)
    {
        if ($index == -1) {
            $index = count($this->lineStrings) - 1;
        }

        $lineStringClass = $this->getNamespace() . '\LineString';

        return new $lineStringClass($this->lineStrings[$index], $this->srid);
    }
1326967
public static function addslashes($str)
    {
        if(is_array($str)){
            foreach($str as $key=>$val){
                $str[$key] = self::addslashes($val);
            }
            return $str;
        }
        return addslashes($str);
    }
1125126
public function replace(self $find, self $replace){
		return new static(\str_replace($find, $replace, $this->_Value), $this->_Encoding);
	}
152578
public function searchValue($index): self
    {
        $this->generatorToArray();

        // init
        $return = [];

        if ($this->array === []) {
            return static::create(
                [],
                $this->iteratorClass,
                false
            );
        }

        // php cast "bool"-index into "int"-index
        if ((bool) $index === $index) {
            $index = (int) $index;
        }

        if (\array_key_exists($index, $this->array) === true) {
            $return = [$this->array[$index]];
        }

        return static::create(
            $return,
            $this->iteratorClass,
            false
        );
    }
277524
public function rowExclude(int $index) : self
    {
        $b = $this->a;

        unset($b[$index]);

        $b = array_values($b);

        return self::quick($b);
    }
467593
public static function replaceRoman(string $str) : string
    {
        $str = self::strToArray($str);
        return implode('', self::replaceRomanArray($str));
    }
1329755
public function insert($substring, $index)
    {
        $stringy = static::create($this->str, $this->encoding);
        if ($index > $stringy->length()) {
            return $stringy;
        }

        $start = \mb_substr($stringy->str, 0, $index, $stringy->encoding);
        $end = \mb_substr($stringy->str, $index, $stringy->length(),
            $stringy->encoding);

        $stringy->str = $start . $substring . $end;

        return $stringy;
    }
661421
private function strAdd(string $str, string $insertstr, int $pos):string
    {
        $str = substr($str, 0, $pos) . $insertstr . substr($str, $pos);
        return $str;
    }
1318094
protected function _auto($str) {
		$self=$this;
		return preg_replace_callback(
			'/`.*?<(.+?)>.*?`|<(.+?)>/',
			function($expr) use($self) {
				if (empty($expr[1]) && parse_url($expr[2],PHP_URL_SCHEME)) {
					$expr[2]=$self->esc($expr[2]);
					return '<a href="'.$expr[2].'">'.$expr[2].'</a>';
				}
				return $expr[0];
			},
			$str
		);
	}
1312808
public function setIndex($index): self
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        $this->_index = (string) $index;

        return $this;
    }
332002
public function setIndex($index)
    {
        $this->index = $index;

        $this->setIndexClean(
            str_replace('.', '', $index)
        );

        return $this;
    }
367977
public static String idx( String str, int index, char c ) {

        char[] chars = str.toCharArray();
        Chr.idx( chars, index, c );
        return new String( chars );
    }
991587
public function getRing($index)
    {
        if (-1 == $index) {
            $index = count($this->rings) - 1;
        }

        $lineStringClass = $this->getNamespace() . '\LineString';

        return new $lineStringClass($this->rings[$index], $this->srid);
    }