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 -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -