Hi,
I am trying to accomplish this in JScript and ASP. I can get the last folder in the path, but not the 2nd last one. For instance in the example below, I can "Sales Agreement", but I am not able to get "Standard Form Agreements and Templates". How can I get that?
Thanks.
My browser output is this:
This is the code that outputs the above output:
I am trying to accomplish this in JScript and ASP. I can get the last folder in the path, but not the 2nd last one. For instance in the example below, I can "Sales Agreement", but I am not able to get "Standard Form Agreements and Templates". How can I get that?
Thanks.
My browser output is this:
Code:
Folder: \\monet\deptweb\Contracts\Standard Form Agreements and Templates\Sales Agreement
folderPath1: monet/deptweb/Contracts/Standard Form Agreements and Templates/Sales Agreement
folderPath2: monet,deptweb,Contracts,Standard Form Agreements and Templates,Sales Agreement
folderDisplay1: Sales Agreement
folderDisplay2: undefined
This is the code that outputs the above output:
Code:
var folderString1 = folderspec;
var folderPath1 = folderString1.substr(2, folderString1.length - 2);
Response.Write ("folderPath1: " + folderPath1 + "<br/>");
var folderPath2 = folderPath1.split("/");
Response.Write ("folderPath2: " + folderPath2 + "<br/>");
var folderPathLen1 = folderPath2.length;
var folderDisplay1 = folderPath2[folderPathLen1-1];
var folderDisplay2 = folderPath2[folderPathLen1];
Response.Write ("folderDisplay1: " + folderDisplay1 + "<br/>");
Response.Write ("folderDisplay2: " + folderDisplay2 + "<br/>");