Replace all backslashes in a string with a pipe

后端 未结 2 1580
不知归路
不知归路 2020-12-06 04:48

I have the string: \\rnosapmdwq\\salesforce\\R3Q\\OutputFiles\\Archive

I\'m getting a unrecognized escape sequence when I try to send this to a .NET web service.

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-06 05:23

    You don't need to make a regex a string, and it helps having that first / in there

    Path = Path.replace(/\\/g, "|")
    

提交回复
热议问题