What is the purpose of the string taped to the front of the canopy on gliders?
Yes, the yaw string on the canopy of a glider is there to show you whether or not you are coordinated, especially during turns.  It indicates the relative wind, so will be straight unless the glider is slipping or skidding, in which case it will swing to the left or right.

For those not familiar with them, here is an image that shows one:



According to Wikipedia, they are also used on other aircraft (even jet fighters and the U-2!) although they are used in almost every glider.

Now, the advantages that it has over an actual instrument installed in the panel are numerous:


It is directly in your line of sight while looking outside, so you don't have to look at the instrument panel to see if you are yawing.
It is more sensitive 
It reacts faster to changes
It is cheaper
It is lighter
It doesn't require electricity (or even an electrical system on the glider)
It costs far less to maintain
It is easy to recognize when it fails (it's either there or not)