regex to removing spaces before and after column code example Example: regex to remove spaces //.. return str.replace(/\s/g, ''); //..