function CodePointString::indexOf
Overrides AbstractString::indexOf
File
-
vendor/
symfony/ string/ CodePointString.php, line 117
Class
- CodePointString
- Represents a string of Unicode code points encoded as UTF-8.
Namespace
Symfony\Component\StringCode
public function indexOf(string|iterable|AbstractString $needle, int $offset = 0) : ?int {
if ($needle instanceof AbstractString) {
$needle = $needle->string;
}
elseif (!\is_string($needle)) {
return parent::indexOf($needle, $offset);
}
if ('' === $needle) {
return null;
}
$i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8');
return false === $i ? null : $i;
}