Example #1
0
 public function testFind()
 {
     $this->eq(s::find('abcdef', 'cde'), 2);
     $this->eq(s::find('abcdef', 'xyz'), null);
     $this->eq(s::find('abcdef', 'abcdef'), 0);
     $this->eq(s::find('abcdef', 'abcdefghi'), null);
     $this->eq(s::find('abcdef', ''), 0);
     $this->eq(s::find('', 'abc'), null);
     $this->eq(s::find('', ''), 0);
     $this->eq(s::find('abcdef', 'bcd', 2), null);
     $this->eq(s::find('abcdef', 'de', 2), 3);
     $this->eq(s::find('abcdef', '', 2), 2);
     $this->eq(s::find('abcdef', 'bcd', 10), null);
     $this->eq(s::find('xxxabcxxxabcxxx', 'abc'), 3);
 }
Example #2
0
 public function find($substr, $offset = 0)
 {
     return s::find($this->value, self::unwrap($substr), $offset);
 }