Unicode::truncateBytes

public static Unicode::truncateBytes($string, $len) Truncates a UTF-8-encoded string safely to a number of bytes. If the end position is in the middle of a UTF-8 sequence, it scans backwards until the beginning of the byte sequence. Use this function whenever you want to chop off a string at an unsure location. On the other hand, if you're sure that you're splitting on a character boundary (e.g. after using strpos() or similar), you can safely use substr() instead. Parameters string $string: T

Unicode::ucwords

public static Unicode::ucwords($text) Capitalizes the first character of each word in a UTF-8 string. Parameters string $text: The text that will be converted. Return value string The input $text with each word capitalized. Related topics PHP wrapper functions Functions that are wrappers or custom implementations of PHP functions. File core/lib/Drupal/Component/Utility/Unicode.php, line 377 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component

UnmetDependenciesException

An exception thrown if configuration has unmet dependencies. Hierarchy class \Drupal\Core\Config\ConfigException extends \RuntimeExceptionclass \Drupal\Core\Config\UnmetDependenciesException File core/lib/Drupal/Core/Config/UnmetDependenciesException.php, line 11 Namespace Drupal\Core\Config Members Name Modifiers Type Description UnmetDependenciesException::$configObjects protected property A list of configuration objects that have unmet dependencies. UnmetDependenci

Unicode::ucfirst

public static Unicode::ucfirst($text) 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 core/lib/Drupal/Component/Utility/Unicode.php, line 346 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

Unicode::validateUtf8

public static Unicode::validateUtf8($text) Checks whether a string is valid UTF-8. All functions designed to filter input should use drupal_validate_utf8 to ensure they operate on valid UTF-8 strings to prevent bypass of the filter. When text containing an invalid UTF-8 lead byte (0xC0 - 0xFF) is presented as UTF-8 to Internet Explorer 6, the program may misinterpret subsequent bytes. When these subsequent bytes are HTML control characters such as quotes or angle brackets, parts of the text tha

Unicode::strlen

public static Unicode::strlen($text) Counts the number of characters in a UTF-8 string. This is less than or equal to the byte count. Parameters string $text: The string to run the operation on. Return value int The length of the string. File core/lib/Drupal/Component/Utility/Unicode.php, line 283 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code public static function strlen($text) { if (static::getStatus() == static::STATUS

Unicode::strtoupper

public static Unicode::strtoupper($text) Converts a UTF-8 string to uppercase. Parameters string $text: The string to run the operation on. Return value string The string in uppercase. File core/lib/Drupal/Component/Utility/Unicode.php, line 302 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code public static function strtoupper($text) { if (static::getStatus() == static::STATUS_MULTIBYTE) { return mb_strtoupper($text);

Unicode::strpos

public static Unicode::strpos($haystack, $needle, $offset = 0) Finds the position of the first occurrence of a string in another string. Parameters string $haystack: The string to search in. string $needle: The string to find in $haystack. int $offset: If specified, start the search at this number of characters from the beginning (default 0). Return value int|false The position where $needle occurs in $haystack, always relative to the beginning (independent of $offset), or FALSE if not found.

Unicode::strtolower

public static Unicode::strtolower($text) Converts a UTF-8 string to lowercase. Parameters string $text: The string to run the operation on. Return value string The string in lowercase. File core/lib/Drupal/Component/Utility/Unicode.php, line 324 Class Unicode Provides Unicode-related conversions and operations. Namespace Drupal\Component\Utility Code public static function strtolower($text) { if (static::getStatus() == static::STATUS_MULTIBYTE) { return mb_strtolower($text);

Unicode::substr

public static Unicode::substr($text, $start, $length = NULL) Cuts off a piece of a string based on character indices and counts. Follows the same behavior as PHP's own substr() function. Note that for cutting off a string at a known character/substring location, the usage of PHP's normal strpos/substr is safe and much faster. Parameters string $text: The input string. int $start: The position at which to start reading. int $length: The number of characters to read. Return value string The sho