The metaphor you mentioned is a simplified way of explaining the concept of gravity and how it keeps celestial bodies, like the Moon, in orbit around larger objects, such as the Earth. However, it is important to note that there is no literal "string" connecting the Earth and the Moon.
Gravity is the force of attraction between objects with mass. In the case of the Earth and the Moon, their masses create a gravitational pull towards each other. This gravitational force is what keeps the Moon in orbit around the Earth, similar to how a ball on a string swings around when you wave it.
In reality, the gravitational force between the Earth and the Moon acts as if there were an invisible force connecting them, exerting a pull on the Moon and keeping it in its orbit. This force is not a physical string, but rather a manifestation of the fundamental physical law of gravity.
So, to answer your question, there is no literal piece of string connecting the Earth and the Moon. The "string" is simply a metaphorical way of explaining the gravitational force that keeps the Moon in orbit around the Earth.