- Get the file name from the file path
Solution:
var fileName = fullPath.replace(/^.*[\\\/]/, ''); // This will handle both \ or / in paths.
Solution:
var fileName = fullPath.replace(/^.*[\\\/]/, ''); // This will handle both \ or / in paths.
转载于:https://www.cnblogs.com/Johnsonxiong/p/10646484.html