/** * @param $value * @return int * @throws ElementNotFoundException */ public function locate($value) { if ($this->hString->contains($value)) { return mb_strpos($this->hString, (string) $value, null, $this->hString->getEncoding()); } throw new ElementNotFoundException($value); }
private function getSuffix($start) { return mb_substr($this->hString, $start + 1, $this->hString->count() - $start, $this->hString->getEncoding()); }
private function getSuffix($key) { $start = $key >= 0 ? $key : $this->hString->count() + $key; $length = $key >= 0 ? $this->hString->count() : $this->hString->count() + $key; return mb_substr($this->hString, $start, $length, $this->hString->getEncoding()); }
public function __construct(HString $hString) { $this->str = $hString->toString(); $this->encoding = $hString->getEncoding(); }