The phrase is considered rude and inappropriate in formal or polite situations. He forgot he was at a job interview and started to swear like a trooper.
Pro Tip 2/3
Intensity of Emotion
Often used to express extreme anger or frustration. Stuck in traffic, Helen began to swear like a trooper.
Pro Tip 3/3
Cultural Perception
Troopers were historically reputed for harsh language, but the term now reflects the speaker's behavior. His grandfather was an army man but never would swear like a trooper.