Tomato plants are attractive to many different types of worms. This is a guide about worms eating tomatoes.
What are those short, fat, gray worms eating my tomatoes? How do I get rid of them?
Hardiness Zone: 6a
By kjdaly from Ferndale, MI
The white worm you are talking about are called Grubs. I'm not sure how to get rid of them, but at least now you have the name to start researching.
Pick them off & mash them with your shoe & spray them with malathion, you can get it from Lowe's or garden center. It's good to keep almost all insects out of a veggie garden & flowers, good luck.