You are here

public function TranslatableMarkup::count in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php \Drupal\Core\StringTranslation\TranslatableMarkup::count()
  2. 10 core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php \Drupal\Core\StringTranslation\TranslatableMarkup::count()

Returns the string length.

Return value

int The length of the string.

Overrides FormattableMarkup::count

File

core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php, line 227

Class

TranslatableMarkup
Provides translatable markup class.

Namespace

Drupal\Core\StringTranslation

Code

public function count() {
  return mb_strlen($this
    ->render());
}