Example #1
0
 public function testTrim()
 {
     $this->eq(s::trim('   a   '), 'a');
     $this->eq(s::trim("\n\ta "), 'a');
     $this->eq(s::trim('   a'), 'a');
     $this->eq(s::trim('a   '), 'a');
     $this->eq(s::trim('a'), 'a');
     $this->eq(s::trim('  a   a  '), 'a   a');
     $this->eq(s::trim(''), '');
     $this->eq(s::trim('abcxyzcba', 'abc'), 'xyz');
 }
Example #2
0
 public function trim($chars = null)
 {
     return new self(s::trim($this->value, self::unwrap($chars)));
 }