Since the yarn is longer than the ruler, mark where the string meets the end of the ruler with a pencil, or with your finger. Then, move the ruler up until the end of the string, record the length. Finally, add the two lengths.
EXAMPLE:
The ruler is 12 inches long. The string continues for 3 more inches. Add the two, the string is 15 inches.