Non-offensive substitute for a swear word
The general term for these is euphemism.
The use of a word or phrase to replace another with one that is considered less offensive or less vulgar than the word or phrase it replaces.
Edit: just found another term: minced oath. I've never actually heard this term used, mind you, but still, it's a closer match than plain "euphemism".
I would call this a minced oath:
an expression based on a profanity or a taboo term that has been altered to reduce the objectionable characteristics.
Lots of fun stuff like "strewth", "cheese and rice"...
The basic process is called euphemizing (replacing a "harsh" word with a "softer" word or phrase).