예제 #1
0
 public function testInsert()
 {
     $this->eq(s::insert('abcdef', 'x', 2), 'abxcdef');
     $this->eq(s::insert('abcdef', 'x', -2), 'abcdxef');
     $this->eq(s::insert('abcdef', 'x', 100), 'abcdefx');
     $this->eq(s::insert('abcdef', 'x', -100), 'xabcdef');
     $this->eq(s::insert('', 'x', 5), 'x');
 }
예제 #2
0
 public function insert($new, $offset)
 {
     return new self(s::insert($this->value, self::unwrap($new), $offset));
 }