Pinku

Pinku

  • 1.4k
  • 302
  • 45.2k

How to remove space before a special character in sql

Oct 11 2024 4:31 PM

I have a string where there is a space before the Special character in between the word sustainability and -energy.
 DECLARE @Title AS VARCHAR(max)='sustainability -energy and power' so I want to make it like 'sustainability-energy and power' .
It should only remove the space before that special character(-). the special character can be any thing.


Answers (2)