How can I stop swearing when I hear it all of the time at work?

Question:
Even though I am very careful about swearing, how can I stop it when I hear it all of the time at work, and then find myself saying it in public?

Answer:
In our Lord’s high priestly prayer to the Father in John chapter 17, He prayed these words, “I have given them Thy Word; and the world hath hated them, because they are not of the world, even as I am not of the world. I PRAY NOT THAT THOU SHOULDEST TAKE THEM OUT OF THE WORLD, BUT THAT THOU SHOULDEST KEEP THEM FROM THE EVIL. They are not of the world, even as I am not of the world. SANCTIFY THEM THROUGH THY TRUTH: THY WORD IS TRUTH. As Thou hast sent Me into the world, even so have I also sent them into the world. AND FOR THEIR SAKES I SANCTIFY MYSELF, THAT THEY ALSO MIGHT BE SANCTIFIED THROUGH THE TRUTH.”

I commend these words of our blessed Lord to you for your meditation because I believe the answer to your dilemma lies in the truth of these words. When the Lord prayed these words, He knew that He was going back to the Father and that He would be leaving His own in a world that was contrary to God. He knew that they were rubbing shoulders every day with those who hated them and who were characterized as evil.
But He prayed that they would be kept from the evil. He knew that this could only be accomplished through the Word (verse 17) and by His being sanctified (verse 19). I believe He meant that the believer can only escape the evil that is in the world (in your case, swearing) by being occupied with God’s Word (verse 17) and with Christ in the glory.
When Jesus said He would, for their sakes, sanctify Himself, He referred to the fact that He would “SET Himself APART” (sanctify means to be “set apart”) in the glory to be the Object for the believer while he travels through this defiling world. It is only as our hearts are taken up with Christ, through the Word, that we will be kept from all the evil that is in the world.
To illustrate further what I mean, allow me to speak of a personal experience. I worked for 10 years in a factory where I was constantly exposed to swearing. I hated it and when I could (on work breaks) I left the room. But most of the time I had to endure it. By the grace of God, I would meditate on Scripture and this replaced the “gutter talk” of my co-workers with holy thoughts from God. It was at times like these that the word of the Psalmist came home to my heart, “Thy Word have I hid in mine heart, that I might not sin against thee” (Psalm 119:11). At times, I still felt defiled at the end of the day (though I had not engaged in swearing) from what I had heard, so I would go home and study Scripture to cleanse my mind of anything that I had not let go (see Psalm 119:9). This is, I believe, what the symbolic act of feet-washing is all about (see John 13:1-8). We must allow the Saviour, through the washing of the water by the Word (see Ephesians 5:26), to cleanse us from any defilement we may have picked up by traveling through this wicked world. May the Lord bless these thoughts to you and give you the grace to overcome swearing by the power of His Word.