@ed Cut your nails really short, and do it four times a week if you need. Do not hurt yourself, but keep your nails in a short size.
That's what I did, and now I don't bite them anymore (but I need them to be reeeeally short all the time) and it doesn't hurt me anymore (because I hurt myself biting my nails, yes ><').
Avoid stress can help too I guess, but it is harder to do.
Anyway, good luck with that. :)