用&符替换子串

时间:2013-10-29 20:36:36

标签: batch-file replace special-characters ampersand

我可以根据example,替换为m

@set str=abc,xyz
@echo %str:,=m%

但是,我无法用&符替换它,

@set str=abc,xyz
@echo %str:,=&%

1 个答案:

答案 0 :(得分:4)

@echo %str:,=^&%

you need to escape it