Famous story, here recounted by The Daily News:
Harold Brodkey used to tell the tale of how legendary New Yorker magazine editor William Shawn handled his use of a four-letter word: It's up to you, Shawn said, but would you rather be remembered for your story or the first use of that word in this magazine? Brodkey spiked the offending expletive.
Shawn was indeed vigilant against vulgarity. It's said that, being afraid of elevators, he used to carry a hatchet in his briefcase in case he was ever trapped inside one. But I like to think the weapon served also as a warning to staffers who did not get the message: This is a clean magazine!
As it happens, Shawn was not the last New Yorker editor averse to the baser corners of the language. A dirty little secret of The New Yorker archives: his successors, Gottlieb, Brown and Remnick, are only slightly less so. Forthwith, a compendium of New Yorker firsts in vulgarity.