Replace Multiple Spaces in String with Single Space.

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 231
DECLARE @str_val varchar(1500)
SET @str_val = 'Hello Welcome to DotNetFunda.com'
Select REPLACE(REPLACE(REPLACE(@str_val,' ','{}'),'}{',''),'{}',' ')


Output:-
Hello Welcome to DotNetFunda.com

Comments or Responses

Login to post response