You are here

public static function Unicode::ucfirst in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Utility/Unicode.php \Drupal\Component\Utility\Unicode::ucfirst()

Capitalizes the first character of a UTF-8 string.

Parameters

string $text: The string to convert.

Return value

string The string with the first character as uppercase.

9 calls to Unicode::ucfirst()
DateTestBase::createField in core/modules/datetime/tests/src/Functional/DateTestBase.php
Creates a date test field.
DependencyTest::testMissingModules in core/modules/system/tests/src/Functional/Module/DependencyTest.php
Attempts to enable a module with a missing dependency.
drupal_verify_profile in core/includes/install.inc
Verifies that all dependencies are met for a given installation profile.
HandlerBase::caseTransform in core/modules/views/src/Plugin/views/HandlerBase.php
Transform a string by a certain method.
OverviewTerms::buildForm in core/modules/taxonomy/src/Form/OverviewTerms.php
Form constructor.

... See full list

File

core/lib/Drupal/Component/Utility/Unicode.php, line 237

Class

Unicode
Provides Unicode-related conversions and operations.

Namespace

Drupal\Component\Utility

Code

public static function ucfirst($text) {
  return mb_strtoupper(mb_substr($text, 0, 1)) . mb_substr($text, 1);
}