We would like to know how to replace all commas in a string.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
<!-- w w w . j a va 2 s. c o m-->
var mystring = "this,is,a,test"
document.writeln(mystring.replace(/,/g , ":"));
</script>
</head>
<body>
</body>
</html>
The code above is rendered as follows: