Question : How to format a message in javascript

Hi There,

I have a response in this format

[["A","test","test","test","2010-06-24 00:00:00.0"]]

How to convert the above format into this format using javascript

"A","test","test","test","2010-06-24 00:00:00.0"

Thanks.

Answer : How to format a message in javascript

Use : string = string.split(",");
You get an array :

string[0] is equal "A"
to get A use : string0 = new String(string[0]);

or use : string = string.replace(/\"/g,"").split(",");

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
<html><head></head><body>
<script type="text/javascript">
	var aofa = [["A","test","test","test","2010-06-24 00:00:00.0"]];
	var string = aofa.toString(); 
	var string = string.replace(/\[|\]/g,"");
	alert(string);
	string = string.replace(/\"/g,"").split(",");
	alert(string[0]);
	alert(string[1]);
	alert(string[2]);
	alert(string[3]);
	alert(string[4]);
</script>
</body></html>
Random Solutions  
 
programming4us programming4us