"\"反斜杠的转义--File的separator 字段
2013-10-30 11:39
1011 查看
java.io.File
separator
public static final String separator
与系统有关的默认名称分隔符,为了方便,它被表示为一个字符串。此字符串只包含一个字符
这是API上的写的;具体的作用是我们看了看能很欢喜:
与系统有关的默认名称分隔符。此字段被初始化为包含系统属性
file.separator值的第一个字符。在 UNIX 系统上,此字段的值为
'/';在 Microsoft Windows 系统上,它为
'\\'。
好处是他能识别系统,根据是同来确定你要的是什么,这就为我们省了很多的时间来处理这些问题,使用很简单,就怕用的时候想不到
相关文章推荐
- oracle修改字段类型时报"要更改的列必须为空"处理方法
- Unity3d 提示 "The scripts file name does not match the name of the class defined in the script!"的解决办法
- cordova 企业应用打包Archive的时候报 "#import <Cordova file not found"
- js split方法针对单个"\"反斜杠
- Erlang 编译时出现"no such file or directory" 与 当前工作目录问题
- 在Eclipse中运行C++程序出现"Launch failed. Binary not foud"和"Program file not Specified"的问题
- 编译驱动时出现"Cannot open file trace.h"错误
- 【转】eclipse 错误信息 "File Search" has encounter a problem 解决
- file_get_content警告Unable to find the wrapper "https"
- String filePath = request.getSession().getServletContext().getRealPath("/");这句话返回的路径是什么,解释下getRealPath("/")函数中的"/"表示什么意思
- iOS:编译时出现"no such file or directory:xxx"以及"use twice...filenames are used to distinguish private dec
- "makefile:5: *** missing separator. Stop."
- Qt5.2.0创建空Qt项目时提示 "QApplication": No such file or directory 解决方案
- "makefile:5: *** missing separator. Stop."【转】
- "[用户名] is not in the sudoers file"(已解决)
- 数据库字段为何会显示为[user]而不是user,外面多个 "[]"?
- FCKeditor出现"this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx"错误的解决办法【转】
- "reason":"No handler for type [attachment] declared on field [file]" 最完全解决方案
- 使用yum命令时报 "No such file or directory"
- 关于vs2010+QT Addin 创建类时弹出"Not a valid .h file"的解决方法