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<
Another one
var filename = fullPath.split(/[\\\/]/).pop();
Here split have a regular expression with a character class
The two characters have to be escaped with '\'
Or use array to split
var filename = fullPath.split(['/','\\']).pop();
It would be the way to dynamically push more separators into an array, if needed.
If fullPath
is explicitly set by a string in your code it need to escape the backslash!
Like "C:\\Documents and Settings\\img\\recycled log.jpg"