Weedwhackers can definitely be used to kill weeds, hence the name. Many people including myself use them for that purpose, it's a real quick and dirty way of controlling them, but you have to be pretty good with it.
The simple trauma of the weed being whipped so hard and so much by the string can be enough to kill a weed, or any plant, alone. It's the same way a tree or bush dies from being constantly exposed to heavy winds, it's just too much for it. But the general idea is to cut them down.
You should start by cutting the weed as low as you can. The weedwhacker string often hits the weed so hard it cuts right through it, but if the weed has really thick stems or stalks it may not be able to do it in one go. If it can't, a lot of strings are serrated so as the weed is getting smacked the string drags across the outside of it and starts to cut little grooves into it, until finally that part of the weed bursts open and the string cuts all the way through, bringing the weed down. Another technique is to weedwhack the top of the weed until it's disintegrated and progressively working your way down, that way when you get to the thick part of the stem it will already be weakened and the string should be able to get through it.
The idea is you're taking away the weed's food supply, and if you cut it really short, even if it survives the weedwhacking, it won't have enough food to be able to grow back, and will rot away in the sun over the next few days, the same way your grass would die if you cut it too short. If the weed is by itself or in a group, after you bring the weed down, you can also angle the weedwahcker down towards the little stem that's left and really dig into the weed, further reducing the weed's chances to live, and, if it's a shallow weed, sometimes it's enough to actually dig the weed up. Any remainders of the weed should be weedwhacked too, until there's noting left of the plant, to avoid the possibility of any part of it rerroting.
It's also important to make sure the weedwhacker is hitting the weed as hard as possible without wasting the string. If the weed is getting hit hard enough, the friction can be so great from the whipping action that the string also burns the weed alive as it cuts it. If you've ever edged the yard before with the weedwhacker, you usually see the grass turn brown where it got hit, which is caused by this. Again, even if the weed survives the weedwhacking, anything that was cut away can't be grown back because of the burns, and the weed is forced to start all over, which, provided enough of it was cut away, it won't have enough food left to do.
It's true there are weeds for which the weedwhacker isn't very effective at all on, including those that are very deeply rooted. Also, as already mentioned some weeds' seeds are spread by weedwhacking them, but at least you've killed the majority of them for the itme being. I use it on the weeds around my house, which are nu,numerous and aggressive, and the majority die, and I only have to do really big sessions with it 5 or 6 times out of the year.