src/StringBuilder.php
public function trimRight($characters = null)
    {
        $this->string = rtrim($this->string, $characters);
        return $this;
    }
public function trimRight($characters = null)
    {
        $this->string = rtrim($this->string, $characters);
        return $this;
    }
Trim characters from the right side of this sequence.

@param string|null $characters The characters to trim. Leave empty for whitespaces.

@return StringBuilder