code: public function endsWith($string)
      {
          $string = static::convertString($string, $this->encoding);
  
          return $string === $this->substring($this->length() - mb_strlen($string, $this->encoding))->__toString();
      }
docs: Check if this sequence ends with a given string.
  
  @param string $string The sequence to search for.
  
  @return bool