function FormattableMarkup::count

Same name in other branches
  1. 9 core/lib/Drupal/Component/Render/FormattableMarkup.php \Drupal\Component\Render\FormattableMarkup::count()
  2. 8.9.x core/lib/Drupal/Component/Render/FormattableMarkup.php \Drupal\Component\Render\FormattableMarkup::count()
  3. 10 core/lib/Drupal/Component/Render/FormattableMarkup.php \Drupal\Component\Render\FormattableMarkup::count()

Returns the string length.

Return value

int The length of the string.

1 method overrides FormattableMarkup::count()
TranslatableMarkup::count in core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php
Returns the string length.

File

core/lib/Drupal/Component/Render/FormattableMarkup.php, line 87

Class

FormattableMarkup
Formats a string for HTML display by replacing variable placeholders.

Namespace

Drupal\Component\Render

Code

public function count() : int {
    return mb_strlen($this->string);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.