Q: How can I replace '/' in a Javascript string with another character 
Possible Duplicate:
JavaScript replace all / with \ in a string? 

I have a date='13/12/2010' I want to replace this '/' to '_' or something else.
I read this  But I do not know how can that applied for my case .

A: Use a global RegEx (g = global = replace all occurrences) for replace.
date = date.replace(/\//g, '_');

\/ is the escaped form of /. This is required, because otherwise the // will be interpreted as a comment. Have a look at the syntax highlighting:
date = date.replace(///g, '_');


A: One easiest thing :)
var date='13/12/2010';
alert(date.split("/").join("_")); // alerts 13_12_2010

This method doesn't invoke regular expression engine and most efficient one 

A: You can try escaping the / character like this -
date.replace( /\//g,"_");

