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

Breadcrumb

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

function AbstractString::startsWith

Parameters

string|string[] $prefix:

7 calls to AbstractString::startsWith()
AbstractString::ensureStart in vendor/symfony/string/AbstractString.php
ByteString::startsWith in vendor/symfony/string/ByteString.php
ByteString::startsWith in vendor/symfony/string/ByteString.php
CodePointString::startsWith in vendor/symfony/string/CodePointString.php
CodePointString::startsWith in vendor/symfony/string/CodePointString.php

... See full list

3 methods override AbstractString::startsWith()
ByteString::startsWith in vendor/symfony/string/ByteString.php
CodePointString::startsWith in vendor/symfony/string/CodePointString.php
UnicodeString::startsWith in vendor/symfony/string/UnicodeString.php

File

vendor/symfony/string/AbstractString.php, line 486

Class

AbstractString
Represents a string of abstract characters.

Namespace

Symfony\Component\String

Code

public function startsWith(string|iterable $prefix) : bool {
    if (\is_string($prefix)) {
        throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
    }
    foreach ($prefix as $prefix) {
        if ($this->startsWith((string) $prefix)) {
            return true;
        }
    }
    return false;
}

API Navigation

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