代码改变世界

[JavaScript] Frequently used method or solutions for issues

2019-04-03 02:09  Johnson_强生仔仔  阅读(228)  评论(0编辑  收藏  举报
  • Get the file name from the file path

  Solution:

 

var fileName = fullPath.replace(/^.*[\\\/]/, '');
// This will handle both \ or / in paths.