File.separator或File.pathSeparator [英] File.separator or File.pathSeparator

查看:148
本文介绍了File.separator或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环境变量。您使用; 分隔文件路径,因此Windows File.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 Windows File.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆