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

Breadcrumb

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

function ByteString::endsWith

Overrides AbstractString::endsWith

File

vendor/symfony/string/ByteString.php, line 140

Class

ByteString
Represents a binary-safe string of bytes.

Namespace

Symfony\Component\String

Code

public function endsWith(string|iterable|AbstractString $suffix) : bool {
    if ($suffix instanceof AbstractString) {
        $suffix = $suffix->string;
    }
    elseif (!\is_string($suffix)) {
        return parent::endsWith($suffix);
    }
    return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase);
}

API Navigation

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