Solved

instrrev using jscript

Posted on 2002-04-18
2
736 Views
Last Modified: 2008-02-01
I need to achieve the following piece of vbscript using jscript,
sMapPath = Server.MapPath("\")
sMapPath = Mid(sMapPath, 1, InStrRev(sMapPath,"\")-1) & "\db\mydb.mdb;"

So I basically need jscript equivilants of Mid and InStrRev
0
Comment
Question by:awestrope
2 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 100 total points
Comment Utility
Mid <--> substr
InStrRev <--> lastIndexOf

I think following snippet should work.. I haven't tried it.

var sMapPath = Server.MapPath("\");
sMapPath = sMapPath.substr(0, sMapPath.lastIndexOf("\")-1);
sMapPath = sMapPath + "\db\mydb.mdb;";
0
 

Author Comment

by:awestrope
Comment Utility
Close, helped me get there anyway!
sMapPath = Server.MapPath("\\");
sMapPath = sMapPath.substr(0, sMapPath.lastIndexOf("\\"));
sMapPath = sMapPath + "\\db\\mydb.mdb;";
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now