I am finding this task challenging in AS3.
Excuse me if I am missing something basic/simple or some builtin method which can do this. I am not well versed with RegExp.
I have a DYNAMIC string representing full file path which looks exactly like "d:\temp\abc.doc". I want to extract the filename part from complete string e.g. abc.doc.
I am aware of techniques like using "fullPath.lastIndexOf("\\")" or regular expressions. The problem is it doesn't seem to work if you have "\" in your path. It works with "/". The path being dynamic can't be manipulated to replace "\" with "/" or any other delimiter. My interpretation is that since "\" is used to escape characters - ANY character appearing AFTER "\" is ignored by actionscript. e.g.
var fullPath:String = "A\B\C";
trace(fullPath.length); //**RETURNS 3** since "\B" & "\C"
// are being treated as SINGLE chars
var bSlash:int = fullPath.lastIndexOf("\\") //RETURNS **-1**