how to remove space from string using regex code example Example: regex to remove spaces //.. return str.replace(/\s/g, ''); //..