gpt4 book ai didi

C# '@' 字符串前

转载 作者:IT王子 更新时间:2023-10-29 03:40:39 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
What's the @ in front of a string for .NET?

我在一本C#学习书上找到的

DirectoryInfo dir = new DirectoryInfo(key.Key.ToString() + @":\");

然而,这本书并没有解释“@”符号的用途。我试着搜索 MSDN C# Operators但它没有在那里列出。我可以猜测它允许开发人员不必转义“\”或者它是否允许没有任何转义序列?

这是做什么用的,为什么我要使用 @":\" 而不是 ":\\"

感谢帮助

编辑:类似问题见下方评论

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com