【发布时间】:2021-04-02 12:09:34
【问题描述】:
我需要从这个字符转换;
"\\\\192.168.2.11\\MKRPRTAL-2.11\\TechnicalDocuments\\TechnicalDocumentsCore\\1000020200-test5_ED_R1.pdf"
到:
"192.168.2.11\\MKRPRTAL-2.11\TechnicalDocuments\TechnicalDocumentsCore\1000020200-test5_ED_R1.pdf"
我试过了
rawPath = response2.TechDocSeriBilgiGetirList[0].PhysicalPathCore.Replace(@"\\", @"\").Replace(@"/", @"\");
(response2.TechDocSeriBilgiGetirList[0].PhysicalPathCore) 等于;
"\\\\192.168.2.11\\MKRPRTAL-2.11\\TechnicalDocuments\\TechnicalDocumentsCore\\1000020200-test5_ED_R1.pdf"
【问题讨论】:
-
您如何查看您的字符串?在 Visual Studio 中,字符串以分隔字符显示,因此
\n是换行符,\t是制表符,反斜杠显示为"\\",因此您可能认为您的字符串数量是您想要的两倍t.