How to get the directory of a file?
For example, I pass in a string
C:\\Program Files\\nant\\bin\\nant.exe
I want a function that r
There's no perfect solution, because this functionality isn't built-in, and there's no way to get the system file-separator. You can try:
path = path.substring(0, Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"))); alert(path);