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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -