Friday, May 1, 2009

Javascript + Replace forward slashes '/' with backward slashes '\'.

Hi friends,

Using following Javascript sysntax you can replace forward slashes ('/') with backward slashes ('\') :
var strReplace = "C:\Temp\Temp1\Temp2\text.jpeg";

strReplace = strReplace.replace(new RegExp(/\\/g),"/");

Regardes,

Vijay

No comments:

Post a Comment