The Enterprise D (and presumably other Federation starships as well) have garment reprocessors. This is mentioned somewhat offhandedly in TNG:Cost Of Living, when Worf complains to Troi that his son Alexander sometimes fails to deposit his laundry into this appliance.
It's not made clear how the reprocessor works in detail (e. g., whether it actually cleans the garments, or whether it is just some kind of specialized replicator which breaks down the garments into their molecules and remakes them).
It's also not made clear whether it's just used for civilian clothing or also uniforms. We can assume the uniforms were made of special fabric to meet military specifications, and thus might need special care. On the other hand, the designers would probably not preclude use in a standard garment reprocessor without a compelling reason.
I wonder what happens if you put a starfleet uniform in a garment reprocessor and forget to remove the combadge.