Dog has string hanging out of his rear end. Need advice?

My German Shepherd puppy has string hanging out of its anus. I'm worried he might have ateing a sewing needle. How are I supposed to remove it without the needle hurting my dog?
10 answers 10