give space in regex while removing a word code example Example: regex to remove spaces //.. return str.replace(/\s/g, ''); //..