Question
Can you split with \ ?
Hi guys,
I know I'm missing something simple here but I can't figure it out. Basically what I'm trying to do is:
var filePath = "C:\Documents and Settings\Krishna\Desktop\chooseFiles.jpg";
_global.myName_array = filePath.split("\\");
trace(_global.myName_array);
But when I do that I get:
C:,ocuments and Settings,rishna,esktop,hooseFiles.jpg
So its lopping off the first letter of each split.
Anybody have any ideas how to do this correctly?
Thanks
I know I'm missing something simple here but I can't figure it out. Basically what I'm trying to do is:
var filePath = "C:\Documents and Settings\Krishna\Desktop\chooseFiles.jpg";
_global.myName_array = filePath.split("\\");
trace(_global.myName_array);
But when I do that I get:
C:,ocuments and Settings,rishna,esktop,hooseFiles.jpg
So its lopping off the first letter of each split.
Anybody have any ideas how to do this correctly?
Thanks