Example #1
0
 public function testSpan()
 {
     $this->eq(s::characterRun('aaab', 'a'), 3);
     $this->eq(s::characterRun('xyz', 'a'), 0);
 }
Example #2
0
 /**
  * Strip off the `path` from an absolute path, or return `null` if the
  * path does not match.
  *
  * @param string $abs_path
  * @return string|null
  */
 public function removePath($abs_path)
 {
     return \Jitsu\StringUtil::removePrefix($abs_path, $this->base_path);
 }
Example #3
0
 public static function capture($callback)
 {
     return new self(s::capture($callback));
 }
Example #4
0
 public function join($str = '')
 {
     return new XString(s::join(XString::unwrap($str), $this->value));
 }