node.js中的path.sep方法使用说明
2014-12-08 11:54
881 查看
方法说明:
将特定文字分隔符 ‘\\' 或 ‘/' 的字符串转换成数组对象。
语法:
复制代码 代码如下:path.sep
由于该方法属于path模块,使用前需要引入path模块(var path= require(“path”) )
接收参数:
无
例子:
复制代码 代码如下:*nix 系统下的例子:
'foo/bar/baz'.split(path.sep)
// returns
['foo', 'bar', 'baz']
windows 系统下的例子
'foo\\bar\\baz'.split(path.sep)
// returns
['foo', 'bar', 'baz']
您可能感兴趣的文章:
相关文章推荐
- node.js中的path.sep方法使用说明
- node.js中的path.delimiter方法使用说明
- node.js中的path.dirname方法使用说明
- node.js中的path.resolve方法使用说明
- node.js中的path.isAbsolute方法使用说明
- node.js中的path.resolve方法使用说明
- node.js中的path.isAbsolute方法使用说明
- node.js中的path.extname方法使用说明
- node.js中的fs.realpathSync方法使用说明
- node.js中的path.basename方法使用说明
- node.js中的path.normalize方法使用说明
- node.js中的path.dirname方法使用说明
- node.js中的path.normalize方法使用说明
- node.js中的path.delimiter方法使用说明
- node.js中的path.resolve方法使用说明
- node.js中的fs.realpathSync方法使用说明
- node.js中的path.basename方法使用说明
- node.js中的path.extname方法使用说明