public function testToArray()
 {
     $string = new Stringer('Hello');
     $this->assertEquals(array('H', 'e', 'l', 'l', 'o'), $string->toArray());
     $string = new Stringer('café');
     $this->assertEquals(array('c', 'a', 'f', 'é'), $string->toArray());
     $string = new Stringer();
     $this->assertEquals(array(), $string->toArray());
 }
Exemplo n.º 2
0
 /**
  * @param string $trimChars
  *
  * @return Stringer
  */
 public function trimStart($trimChars = null)
 {
     if ($trimChars === null) {
         return Stringer::create(ltrim($this->string));
     }
     return Stringer::create(ltrim($this->string, $trimChars));
 }