找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 67|回复: 0

RES.path.globalFunction

[复制链接]

13

主题

0

回帖

30

积分

管理员

积分
30
发表于 2025-9-30 11:21:13 | 显示全部楼层 |阅读模式 IP:安徽
  1. 公共方法
  2. 方法
  3. basename(filename:string):string
  4. 根据文件路径得到文件名字,"C:/A/B/example.ts"=>"example.ts"
  5. dirname(path:string):string
  6. 文件所在文件夹路径,"C:/A/B/example.ts"=>"C:/A/B"
  7. normalize(filename:string):string
  8. 格式化文件路径,"C:/A/B//C//D//example.ts"=>"C:/A/B/C/D/example.ts"
  9. 方法详细信息
  10. basename()
  11. public basename(filename:string):string

  12. 根据文件路径得到文件名字,"C:/A/B/example.ts"=>"example.ts"

  13. 支持版本:Egret 5.2

  14. 运行平台:Web,Native

  15. 参数

  16. filename:string - 传入的文件路径
  17. 返回:文件的名字

  18. dirname()
  19. public dirname(path:string):string

  20. 文件所在文件夹路径,"C:/A/B/example.ts"=>"C:/A/B"

  21. 支持版本:Egret 5.2

  22. 运行平台:Web,Native

  23. 参数

  24. path:string
  25. 返回:文件所在文件夹的地址

  26. normalize()
  27. public normalize(filename:string):string

  28. 格式化文件路径,"C:/A/B//C//D//example.ts"=>"C:/A/B/C/D/example.ts"

  29. 支持版本:Egret 5.2
  30. 运行平台:Web,Native
  31. 参数
  32. filename:string - 传入的文件路径
复制代码

易找素材网-素材不好找?易找帮你找!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表