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.
Loading
Muhammad Imran AnsariPosted Oct 11, 2024, 7:26 PM
Hi Pinku,
You can achieve this by using the REPLACE method using PATINDEX functions. Here is the query:
Thank you.
PinkuPosted Oct 14, 2024, 6:15 AM
Thanks Imran Its working