Intestinal parasites are pretty common in dogs and easily taken care of usually.
If these were long reminding you of pasta they may be round worms.
You can read about worms here and see pictures to help you identify what you saw
If they were round worms then an over the counter wormer containing pyrantel pamoate as the active ingredient is a good safe choice. You need to know your dog's correct weight too. Nemex and Evict are two name brands of wormers with that ingredient in them.
Or you can bring a fresh stool sample to your vet and have them check it for worms to see if any other types are also present. Your vet can then prescribe a safe wormer to eliminate any worms found.
Often you worm once then wait a period of time (depends on the type of worms how long it is) and worm a second time.
Making sure to clean all stools out of the potty areas used can reduce chances of the dog picking worms up again.
Hope this helps you!