regex - How to replace backslash in AS3 Flash? -
i'm trying replace backslashes of url/path file name of swf:
var path:string = "c:\test\myswf.swf" var swfurl:string = path.replace(/\\/gi, "/"); var swffilename:string = path.slice(path.lastindexof("/")+1, path.length).replace(".swf", ""); but doesn't works. response is: 'c:testmyswf.swf'. it's doesn't replace string path. how can it?
i think might need escape backslashes within url string:
var path:string = "c:\\test\\myswf.swf"
Comments
Post a Comment