actionscript 3 - replace doublebackslash with single slash -
how replace doublebackslash single slash? couldnt find example anywhere. ie.
"c:\\this\\is\\a\\folder\\myfile.jpg" "c:\this\is\a\folder\myfile.jpg"
you can use string.replace()
function that:
var rx:regexp = /\\\\/g; var s:string = "c:\\\\folder\\\\folder\\\\folder\\\\file.ext"; trace ( s ); s = s.replace ( rx, "\\" ); trace ( s );
you need escape \
character inside literal strings, that's why it's doubled in code above.
Comments
Post a Comment