If you form the string into a circle and measure distance from the centre of the circle to the edge (ie the radius you can calculate the length of the string using 2.pi.R

This leaves the small problem that if we had such a measuring device, the question could be answered by simply measuring the string, an alternative solution must be sought.

Let us make some assumptions:
The string is at least 1cm in length
Any smaller and calling it a piece of string is perhaps a misnomer, fluff would be a better definition.

The string cannot exceed one ton
Manufacturing such a string would be impractical, and would instead of being named string, would be better termed as a tourist attraction.

String is no thinner than 1.5mm
Thinner than this, and we are entering the territory of thread.

Worst case density is 0.7kg/litre
Otherwise the string will be too weak.

So, we know the maximum weight, and the volume:

1000
---- = 1429 litres or 1.429 cubic metres.
0.7

Therefore, maximum length is

Volume         1.429m
------ =   -------------   
 Area      pix0.5mmx0.5mm
So the string length lies between 1cm and 11,644.39km which can be expressed as above

Paraphrased from "A Mensa Puzzle Book", Victor Serebriakoss; Treasure Press, Bond House, St John's Square, Wolverhampton (1991)