You are here

public static function Unicode::ucfirst in Service Container 7.2

Same name and namespace in other branches
  1. 7 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.

File

lib/Drupal/Component/Utility/Unicode.php, line 351
Contains \Drupal\Component\Utility\Unicode.

Class

Unicode
Provides Unicode-related conversions and operations.

Namespace

Drupal\Component\Utility

Code

public static function ucfirst($text) {
  return static::strtoupper(static::substr($text, 0, 1)) . static::substr($text, 1);
}