public function endsWith(string $value): bool
    {
        if ($value === '') {
            return true;
        }

        return (string) $this->takeEnd(self::of($value, $this->encoding)->length()) === $value;
    }