Error: ‘deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable’ invalid

I was following instructions directly from this link here

https://docs.docker.com/install/linux/docker-ce/ubuntu/

to try to install Docker CE on virtual box running Ubuntu 18.04 LTS, but I get the following error:

Error: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu  bionic  stable' invalid

The exact command I followed is:

$ sudo add-apt-repository 
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
   $(lsb_release -cs) 
   stable"

which was provided in the link above. How can I fix this error?

Source: StackOverflow