By the topic of your post, I think you have several strings you want to append coma to, but there should be no coma. Eg: one,two,three,four
Is that right? If it is, here are two approaches you can follow:
1)
Code:
// Add each of the string as an array item
var strs = [], len=0;
strs[len++] = item1;
strs[len++] = item2;
.
.
.
var finalstr = strs.join();
2)
Code:
function myappend(str, item)
{ return str ? str+","+item : item; }
var mystr;
mystr=myappend(mystr, item1);
mystr=myappend(mystr, item2);
.
.
.
Or if its in a loop, something like this:
Code:
var mystr="";
if(data.hasMore())
mystr=data.next();
while(data.hasMore())
mystr += "," + data.next();
Bookmarks