Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExpectationException.php

function ExpectationException::trimString

Trims string to specified number of chars.

Parameters

string $string response content:

int $count trim count:

Return value

string

1 call to ExpectationException::trimString()
ExpectationException::__toString in vendor/behat/mink/src/Exception/ExpectationException.php
Returns exception message with additional context info.

File

vendor/behat/mink/src/Exception/ExpectationException.php, line 151

Class

ExpectationException
Exception thrown for failed expectations.

Namespace

Behat\Mink\Exception

Code

protected function trimString($string, $count = 1000) {
    $string = trim($string);
    if ($count < mb_strlen($string)) {
        return mb_substr($string, 0, $count - 3) . '...';
    }
    return $string;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal