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

Breadcrumb

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

function ByteString::startsWith

Overrides AbstractString::startsWith

File

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

Class

ByteString
Represents a binary-safe string of bytes.

Namespace

Symfony\Component\String

Code

public function startsWith(string|iterable|AbstractString $prefix) : bool {
    if ($prefix instanceof AbstractString) {
        $prefix = $prefix->string;
    }
    elseif (!\is_string($prefix)) {
        return parent::startsWith($prefix);
    }
    return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix)));
}

API Navigation

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