I want to extract "index.htm" out of "http://domain.com/folder1/folder2/index.htm" for example.

I guess i can reverse the string, do a instr to find the pos of /, the do a mid, and reverse the string back.
Is there an easier/faster way to do it?

Thanks.
Posted on 2003-10-22 02:44:22 by Ghirai
I would go to the end of the string first via strlen, then count backwards till you hit your first '/' and viola..
Posted on 2003-10-22 03:10:11 by drarem
Search the forum for 'filenamefrompath' or something like it. I remember a highly optimized code has been posted for this purpose. One thing you need to change is '\' to '/' for your purpose.

<edit>
This is the thread:
http://www.asmcommunity.net/board/showthread.php?threadid=13541&highlight=filenamefrompath
</edit>
Posted on 2003-10-22 03:21:24 by Starless
Great, thanks!
Posted on 2003-10-22 03:58:17 by Ghirai