我有一个字符串 /Images/Me.jpg
我要替换正斜杠用反斜杠像这样 \图片\ Me.jpg
,IAM使用与string.replace(/,\);但输出 \\ \\图像Me.jpg
请大家帮忙
i have a string /Images/Me.jpg
i want to replace forward slashes with backward slashes like this \Images\Me.jpg
, iam using string.Replace("/","\"); but the output is \\Images\\Me.jpg
please help
您需要逃避斜线
string.Replace("/", "\\")
string.Replace("/", @"\")
视觉工作室智能感知仍然会显示\\,如果你在字符串悬停,你会发现一个放大镜,点击它。这将显示真正的字符串
Visual studios intellisense will still show "\\", if you hover over the string, you will find a magnifying glass, click it. This will show the real string