Get Directory of a File Name in Javascript -
How to obtain a file's directory?
For example, I have a string near
c: \ program files \ nant \ bin \ nant.exe I have a function that gives me
C: \ program files \ nant \ bin let me split the string manually and Instead of leaving the last one, there would be a built-in function in the job.
Edit: I'm running on Windows
I do not know that there is any functionality for this, but it is quite easy to get the path.
path = path.substring (0, path.lastIndexOf ("\") +1);
Comments
Post a Comment