Exemple #1
0
 public function testPregReplace()
 {
     $this->assertEquals('Foo-DEF? Gh: 12', Str::preg_replace('Ąbć-DEF? Gh: 12', '/Ąb./', 'Foo'));
 }
Exemple #2
0
 /**
  * @return StrObject
  */
 public function preg_replace($search, $replace = null)
 {
     if (is_array($search) && func_num_args() == 1) {
         $replace = array_values($search);
         $search = array_keys($search);
     }
     $value = Str::preg_replace($this->value, $search, $replace);
     return new self($value);
 }