Is there a way that I can get the last value (based on the \'\\\' symbol) from a full path?
Example:
C:\\Documents and Settings\\img\\recycled log.jpg<
function getFileName(path, isExtension){
var fullFileName, fileNameWithoutExtension;
// replace \ to /
while( path.indexOf("\\") !== -1 ){
path = path.replace("\\", "/");
}
fullFileName = path.split("/").pop();
return (isExtension) ? fullFileName : fullFileName.slice( 0, fullFileName.lastIndexOf(".") );
}