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