0

Hi I am new to Mysql and Regexp and wanted help in running the below regexp to clear whitespaces from a column called description in my table.

string = string.replace(/\s{2,}/g, ' ');

Can someone please help? I can do basic query's.

Mannie Singh
  • 119
  • 3
  • 17

1 Answers1

2

No need for RegEx in that case.
You can simply use the Trim() function from mySQL.

It will simply remove all the white spaces :

SELECT TRIM('      removeSpaces      ');
--------

OUTPUT : [removeSpaces]   
phadaphunk
  • 12,785
  • 15
  • 73
  • 107