Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CodePointString.php

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\String

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal