为什么用反斜杠替换正斜杠只是转换为正斜杠? [英] Why does replacing Forward slash with backslashes just convert to forward slashes?

查看:74
本文介绍了为什么用反斜杠替换正斜杠只是转换为正斜杠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆