Interview Questions and Answers
Input: abc--------def--------xyzi---------pq Output: abc-def-xyzi-pq
DECLARE @input VARCHAr(500)='abc--------def--------xyzi---------pq'
Select REPLACE(REPLACE(REPLACE(@input,'-','{}'),'}{',''),'{}','-')
DECLARE @input VARCHAr(500)='abc--------def--------xyzi---------pq'
Select REPLACE(REPLACE(REPLACE(@input,'-','{}'),'}{',''),'{}','-')
DECLARE @input VARCHAr(500)='abc--------def--------xyzi---------pq'
Select REPLACE(REPLACE(REPLACE(@input,'-','{}'),'}{',''),'{}','-')
Post a Comment
0 Comments