$ sed 's/\b\(\w\+\)~\(\w\+\)\b/~/g' <<< 'This is a sentence with the cha~racter in the middle of a word.
> This is a sentence with the ~character at the beggining of a word.
> This is a sentence without the character.'
This is a sentence with the ~character in the middle of a word.
This is a sentence with the ~character at the beggining of a word.
This is a sentence without the character.