Your task is to write 2 functions/programs. They may share code.
The first function must, given a string and a character, output a new string that does not contain that character.
The second function must, given the string from the previous function and the excluded character, reconstruct the original string.
All input strings will be ASCII printable, all output strings must be ASCII printable. You may choose to include or exclude whitespace, if you exclude whitespace it must be excluded from both the input and the output.
Examples
One could try to use replace the character with an escape sequence. For example \#bcda
with excluded character becomes \\#bcd\#
then you'd know to replace \#
with whatever character is excluded. However, the excluded character might itself be #
or \
so if one uses this method they'd need to be able to dynamically switch to a different escape sequence in that case.
There is no length limit for the censored string so you could try to encode the entire string in unary, but be careful that the unary char you choose may not be the excluded char.
This is code golf, shortest answer in each language wins. Brownie points for interesting solutions even if they are not the shortest though.