[JavaScript] Frequently used method or solutions for issues

  • Get the file name from the file path

  Solution:

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

猜你喜欢

转载自www.cnblogs.com/Johnsonxiong/p/10646484.html