I have the following method that makes some changes in the passed string:
const updatedText = text.replace(specCharcombination, \'\').replace(/\\ +/g, \' \')