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
With this case, I just want to get recycled log.jpg
from the full path in JavaScript.
var filename = fullPath.replace(/^.*[\\\/]/, '')
This will handle both \ OR / in paths
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With