src/ADT/StringBuffer.php
public function insert( $position, $string )
	{
		if( $position<= $this->count() && $position >=0 )
		{
			if( $position < $this->pointer )
				$this->pointer = $this->pointer + strlen( $string );
			$left	= substr( $this->toString(), 0, $position );
			$right	= substr( $this->toString(), $position );
			$this->buffer = $left.$string.$right;
		}
		return $this->toString();
	}
public function insert( $position, $string )
	{
		if( $position<= $this->count() && $position >=0 )
		{
			if( $position < $this->pointer )
				$this->pointer = $this->pointer + strlen( $string );
			$left	= substr( $this->toString(), 0, $position );
			$right	= substr( $this->toString(), $position );
			$this->buffer = $left.$string.$right;
		}
		return $this->toString();
	}
public function insert ( $ position , $ string ) { if ( $ position <= $ this -> count ( ) && $ position >= 0 ) { if ( $ position < $ this -> pointer ) $ this -> pointer = $ this -> pointer + strlen ( $ string ) ; $ left = substr ( $ this -> toString ( ) , 0 , $ position ) ; $ right = substr ( $ this -> toString ( ) , $ position ) ; $ this -> buffer = $ left . $ string . $ right ; } return $ this -> toString ( ) ; }
Inserts a String at a given Position.
@access		public
@param		int			$position		Position to insert to
@param		string		$string			String to insert
@return		string
Inserts a String at a given Position .