Beispiel #1
0
 public function testTrim()
 {
     $tests = array(' foó ' => 'foó', "\tBar\n" => 'Bar');
     foreach ($tests as $input => $expected) {
         $this->assertEquals($expected, Str::trim($input));
     }
     $this->assertEquals("\nBaz\t", Str::trim("\nBaz\t\r", "\r"));
     $this->assertEquals("Boo", Str::trim("\nBoo\t\r", "", array(preg_quote("\n"), preg_quote("\t"), preg_quote("\r"))));
 }
Beispiel #2
0
 /**
  * Wrapper for trim()
  * @return StrObject
  */
 public function trim()
 {
     $value = Str::trim($this->value);
     return new self($value);
 }