p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Basics (http://p2p.wrox.com/forumdisplay.php?f=61)
-   -   Find a Particular Word (http://p2p.wrox.com/showthread.php?t=6103)

PanzarPaw November 12th, 2003 05:32 PM

Find a Particular Word
hi all!

I'm just about doing a "Try it out" in Beg ASP 3.0 - Chapter 10 - about displaying a Directory. Of course I want to spice it up a bit with some adds of my own.. :)

Everything's just working fine till I got myself this hard nut to crack..

You see, I want to display the Server Path as you can obtain with

but then I only want to display the ONE Parent folder of the .asp file I'm browsing

So I figured, Using the "Finding a Particular Word" - string manipulator - Instr(string, "/") - would be a nice aid for the task.

Only that, the Instr() returns the value of the first occurrence of the "/" starting from the left

Now, Is there a way to make a Instr() search starting from the right?
That I think would just do it! :D

/ Paw

planoie November 12th, 2003 07:07 PM

Try InStrRev()

Work smarter, not harder.

PanzarPaw November 13th, 2003 07:20 PM

Thanks mate!

Of course, now when I knew what to search for, I easily found a reference to the InStrRev() in Appendix D, page 968 (Beginning ASP 3.0).

Experience is the key I guess ..

/ Paw

planoie November 14th, 2003 10:58 AM

After ten minutes of troubleshooting, the consultant pressed one button on the side of a machine and the whole plant started back up. He turned to the plant manager and said, "Ok, all fixed, that'll be $10,000."

The plant manager was shocked, "You're CRAZY! A monkey could have pressed that one button."

The consultant thoughtfully replied, "But would the monkey have known WHICH button to press?"


All times are GMT -4. The time now is 08:31 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.