Leccs
BTW i googled this from Yahoo answers.
If it's a protein fiber (fiber from an animal), such as wool, angora, cashmere, etc: fold it up and put it in a ziploc baggie in your freezer for 24 hours. It will prevent the sweater from shedding. (This is something you should do before every wear)
If it's a cellulose fiber (fiber from a plant), such as cotton, linen, etc: toss it in the dryer for 10 minutes (unless it specifically says dry clean only).
If it's a synthetic (man-made fiber), such as acrylic, polyester, nylon, etc: take it back to the store,
synthetic fibers aren't supposed to shed, so it's a manufacturing defect with the yarn.