So I imported some data and ended up with a leading space in all the supposedly empty cells in a column. To remove, I needed to select the column then:
Edit > Find & Replace
Search For: ^ *
(i.e. a caret, a space, an asterisk)
Replace: leave blank
Click on Other Options and make sure:
- Current selection only
- Regular expressions
were ticked. Then Close
and Replace All
https://ask.libreoffice.org/en/question/72015/how-to-remove-spaces-in-calc/