how to use regex to get rid of spaces punctution code example Example: regex to remove spaces //.. return str.replace(/\s/g, ''); //..