예제 #1
0
 public function testSplit()
 {
     $this->eq(s::split('a b'), array('a', 'b'));
     $this->eq(s::split(''), array());
     $this->eq(s::split('  a  b  '), array('a', 'b'));
     $this->eq(s::split(" \tabc\n  "), array('abc'));
     $this->eq(s::split('aba', 'b'), array('a', 'a'));
     $this->eq(s::split('a', 'a'), array('', ''));
     $this->eq(s::split('abbaba', 'bb'), array('a', 'aba'));
     $this->eq(s::split('ababa', 'b', 1), array('a', 'aba'));
     $this->eq(s::split('ababa', 'b', -1), array('a', 'a'));
 }
예제 #2
0
 public function split($delim = null, $limit = null)
 {
     return new XArray(s::split($this->value, self::unwrap($delim), $limit));
 }