String dirtyString = "Jesus, Fuck this shit"
String newString = dirtyString.Replace("jesus", "jeezy")
newString = newString.Replace("fuck", "fig") // note we edit the new string
newString = newString.Replace("shit", "shoe")
Display(newString); // Displays "jeezy, fig this shoe"
If you have a list of bad words to replace in an array then you can iterate through them to avoid a lot of code duplication.
Note you also have to deal with restoring capitalisation but if its just for chat sanitizing then i doubt it matter.s