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

Breadcrumb

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

function UnicodeString::slice

Overrides AbstractString::slice

File

vendor/symfony/string/UnicodeString.php, line 275

Class

UnicodeString
Represents a string of Unicode grapheme clusters encoded as UTF-8.

Namespace

Symfony\Component\String

Code

public function slice(int $start = 0, ?int $length = null) : static {
    $str = clone $this;
    $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647);
    return $str;
}

API Navigation

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