Powershell -replace when replacement string contains $+

前端 未结 4 1843
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 00:08

I am doing a string replacement in PowerShell. I have no control over the strings that are being replaced, but I can reproduce the issue I\'m having this way:



        
4条回答
  •  失恋的感觉
    2020-12-07 00:18

    I couldn't find it documented but the "Visual Basic" style escaping rule worked, repeat the character.

    'word' -replace 'word','@#$$+' gives you: @#$+

提交回复
热议问题