Hello,
I am trying to build a string that is on one line,
1,2,3,4,5,6,7,8,9
however, I wind up with each number on a separate line.
1,
2,
3,
4,
5,
6,
7,
8,
9
My code looks like this:
var xxx = "";
for (var i=1; i<= nNumWords; i++) {
global.srchVals[i].name = "Payor Mix";
global.srchVals[i].mode = 0;
xxx = i;
if (i < nNumWords) {
xxx = xxx + ",";
//xxx = xxx.replace(/\s+/g,"").trim();
} else {
xxx = xxx;
//xxx = xxx.replace(/\s+/g,"").trim();
}
var PMItms = [xxx];
//console.println(xxx);
}
I tried using the following line of code to remove carriage returns and spaces:
xxx = xxx.replace(/\s+/g,"").trim();
But it keeps on giving me the following error:
TypeError: xxx.replace(/\s+/g, "").trim is not a function
Any help is appreciated.
Thanks
Linda