Stringy\Stringy::collapseWhitespace PHP Метод

collapseWhitespace() публичный метод

Trims the string and replaces consecutive whitespace characters with a single space. This includes tabs and newline characters, as well as multibyte whitespace such as the thin space and ideographic space.
public collapseWhitespace ( ) : Stringy
Результат Stringy Object with a trimmed $str and condensed whitespace
    public function collapseWhitespace()
    {
        return $this->regexReplace('[[:space:]]+', ' ')->trim();
    }