An escape character is an awful lot of fun in programming. It seem to have the ability to allow multiple dimensions where only one dimension is allowed. A disguise, a ruse, a ploy, almost always clever getting out of tight squeezes.
Here is a function that I am very fond of
escapedString =
encode(oldString,
escapeChar,
oldCharacter,
newCharacter);
The function will replace every old character with the new character with a preceding escape character. The function will also escape the escape character itself.
escapedString =
encode(oldString,
escapeChar,
oldCharacterString,
newCharacterString);