src/StringBuilder.php
public function endsWith($string)
    {
        $string = static::convertString($string, $this->encoding);

        return $string === $this->substring($this->length() - mb_strlen($string, $this->encoding))->__toString();
    }
public function endsWith($string)
    {
        $string = static::convertString($string, $this->encoding);

        return $string === $this->substring($this->length() - mb_strlen($string, $this->encoding))->__toString();
    }
Check if this sequence ends with a given string.

@param string $string The sequence to search for.

@return bool