Swearing when you're hurt helps reduce pain.
In a study, volunteers who cursed could tolerate pain for nearly 50% longer than volunteers who did not. Researchers at Keene University submerged volunteers' hands into freezing water to see if swearing affected their pain tolerance. The volunteers could tolerate the pain for 2 minutes when they swore, but only 1 minute and 15 seconds without swearing.
This may be because the act of swearing triggers our natural "fight or flight" response. This would increase our heart rate and downplay the importance of pain. However, if you swear all the time, swearing when experiencing pain will probably not be very effective.
Source