File.separator或File.pathSeparator [英] File.separator or File.pathSeparator
问题描述
在文件
类中有两个字符串, 分隔符
和 pathSeparator
。
In the File
class there are two strings, separator
and pathSeparator
.
有什么区别?
推荐答案
如果你的意思是 File.separator
和 File.pathSeparator
然后:
If you mean File.separator
and File.pathSeparator
then:
-
File.pathSeparator
用于分隔文件路径列表中的各个文件路径。考虑Windows,PATH环境变量。您使用;
分隔文件路径,因此WindowsFile.pathSeparator
将为;
。
File.pathSeparator
is used to separate individual file paths in a list of file paths. Consider on windows, the PATH environment variable. You use a;
to separate the file paths so on WindowsFile.pathSeparator
would be;
.
File.separator
是 /
或 \
,用于将路径分割为特定文件。例如在Windows上,它是 \
或 C:\Documents\Test
File.separator
is either /
or \
that is used to split up the path to a specific file. For example on Windows it is \
or C:\Documents\Test
这篇关于File.separator或File.pathSeparator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!