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

Breadcrumb

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

function AbstractUnicodeString::camel

Overrides AbstractString::camel

1 call to AbstractUnicodeString::camel()
AbstractUnicodeString::snake in vendor/symfony/string/AbstractUnicodeString.php

File

vendor/symfony/string/AbstractUnicodeString.php, line 155

Class

AbstractUnicodeString
Represents a string of abstract Unicode characters.

Namespace

Symfony\Component\String

Code

public function camel() : static {
    $str = clone $this;
    $str->string = str_replace(' ', '', preg_replace_callback('/\\b.(?!\\p{Lu})/u', static function ($m) {
        static $i = 0;
        return 1 === ++$i ? 'İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8') : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8');
    }, preg_replace('/[^\\pL0-9]++/u', ' ', $this->string)));
    return $str;
}

API Navigation

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