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

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

Returns a string with whitespace removed from the start and end of the string. Supports the removal of unicode whitespace. Accepts an optional string of characters to strip instead of the defaults.
public trim ( string $chars = null ) : Stringy
$chars string Optional string of characters to strip
Результат Stringy Object with a trimmed $str
    public function trim($chars = null)
    {
        $chars = $chars ? preg_quote($chars) : '[:space:]';
        return $this->regexReplace("^[{$chars}]+|[{$chars}]+\$", '');
    }