为什么用反斜杠替换正斜杠只是转换为正斜杠? [英] Why does replacing Forward slash with backslashes just convert to forward slashes?
问题描述
在Azure数据工厂中,我有以下表达式:
@replace('hello cr / azy / people','/','\\' )
这相当于'你好cr // azy //  people'
如何获得正确转换为反斜杠的斜杠?
使用 @ replace('hello cr / azy / people','/','\')
你不需要逃避/和\这里。
< span style ="color:#333333"> 如果您看到输出变为
" value":"hello cr \\\\\\\\\\\\\\\ >
这是对的。 \\实际上只是一个反斜杠,因为第一个用于转义第二个。 跨度> 跨度>
In Azure data factory, I have the following expression:
@replace('hello cr/azy/ people','/',' \\ ')
This equates to 'hello cr // azy // people'
How do I get forward slashes to properly convert to backslashes?
Just use @replace('hello cr/azy/ people','/',' \')
You don't need escape / and \ here.
If you see the output becomes
"value": "hello cr \\azy \\ people"
That is right. The \\ is actually just one backslash, as the first one is used to escape the second one.
这篇关于为什么用反斜杠替换正斜杠只是转换为正斜杠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!