How to split a string in JavaScript with the \",
\" as seperator?
Use split to split your string:
"foo,bar,baz".split(",") // returns ["foo","bar","baz"]
var splitString = yourstring.split(',');
See split
var str = "test,test1,test2";
var arrStr = str.split(',');
var arrLength = arrStr.length; //returns 3
var expression = "h,e,l,l,o";
var tokens = expression.split("\,");
alert(tokens[0]);// will return h