Javascript: Get file name from fullpath.

PHOTO EMBED

Mon Aug 29 2022 16:00:23 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #javascript

var filename = fullPath.replace(/^.*[\\\/]/, '');

/*

example:

   "/home/user/myfile.js".replace(/^.*[\\\/]/, ''); 
   
   returns:  myfile.js 
   
*/
content_copyCOPY

Get file name from fullpath.