Forums

This topic is locked

lastIndexOf("\")

Posted 11 Jun 2003 22:14:25
1
has voted
11 Jun 2003 22:14:25 Scott Burtscher posted:
Is there a good way to return the last index of "\"?

ex:
var myFileString=document.getElementById("resumeFile".value
var myFile=myFileString.lastIndexOf("\"

--->When I do it this way I get an unterminated string

var myFile=myFileString.lastIndexOf(""\""

--->When I do it this way I get an invalid character at ....

I'm trying to strip a file name out of a full path so I can attach it to an email.

Replies

Replied 12 Jun 2003 14:22:02
12 Jun 2003 14:22:02 Marja Ribbers-de Vroed replied:
Try:

var myFile=myFileString.lastIndexOf("\\";

--
Marja Ribbers-de Vroed
www.flevooware.nl
www.flevooware.nl/dreamweaver/

Reply to this topic