gpt4 book ai didi

c# - 正斜杠的命名空间常量

转载 作者:行者123 更新时间:2023-11-30 13:34:53 25 4
gpt4 key购买 nike

正斜杠“/”的 .net 命名空间常量是什么

所以代替:

somePath + "/" + someFile

我能做到:

somePath + .net.namespace.forwardslash + someFile

差别不大,但可能更整洁?

最佳答案

System.IO.Path.DirectorySeparatorChar是你想要的我想。

顺便说一句,更明智的方法是使用 System.IO.Path.Combine(somePath,someFile) .

关于c# - 正斜杠的命名空间常量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1673043/

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