コード例 #1
0
 public function testBefore()
 {
     $this->eq(s::before('abc/def', '/'), 'abc');
     $this->eq(s::before('abc/def/ghi', '/'), 'abc');
     $this->eq(s::before('abc', '/'), 'abc');
     $this->eq(s::before('abcdef', ''), '');
     $this->eq(s::before('abcdef', 'abcdef'), '');
     $this->eq(s::before('abc', 'abcdef'), 'abc');
     $this->eq(s::before('', ''), '');
     $this->eq(s::before('', 'abc'), '');
 }
コード例 #2
0
ファイル: XString.php プロジェクト: bdusell/jitsu-wrap
 public function before($substr)
 {
     return new self(s::before($this->value, self::unwrap($substr)));
 }