Question : Enherited code

1:
2:
3:
4:
5:
SET @T = Replace (@T, '"', '\x022')
SET @T = Replace (@T, '''', '\x027')
SET @T = Replace (@T, char(10), '\x0a')
SET @T = Replace (@T, char(13), '\x0d') 


Is there a way to make the code above more efficient?  Also, why the "\"?

Answer : Enherited code

The "\" is an escape character.

You can make it more efficient in a sense by combining it into one line:

SET @T = Replace(Replace(Replace(Replace (@T, '"', '\x022'), '''', '\x027'), char(10), '\x0a'), char(13), '\x0d')
Random Solutions  
 
programming4us programming4us