If this is for real....
Nail 2 nails on a flat surface a set distance apart (1 foot, 1 meter etc). Make some appropriate markings between the nails (inches, centimeters etc).
Mark off 6" of string for the end you will tie to one nail and tie it on starting at that mark (whatever hangs off is already counted) Wind the string around the nails counting the number of complete wraps. Each wrap equals twice your set distance (2 feet, 2 meters etc + your tie amount).
When you get to the end measure it against the markings you made between the nails previously (i.e halfway would be 6" or 50cm etc).
Add it all up for a total that is going to be within 1% of your actual total (loose a tiny amount of distance going around the nails).
Tie amount + (wraps X2) + end remnants = string length
If you need more precision than this....why are you using string?