Print array with no spaces.?

Hi,
Is there a way I can print an array but with no spaces between the commas?
Whenever I get info out of a “log” window as ‘string’ it usually returns the string but with a space as the first character. See the example below, where the letter “b” is actually " b".

Thanks.

Lee

a = newArray("a", "b", "2", "3");
Array.print(a);
a = newArray("a", "b", "2", "3");
o="";
for (i=0;i<lengthOf(a);i++)
o=o+a[i];
print(o);

If it is just the first space after that bothers you (likely when you have extracted text from the log file using getInfo(“window.contents”)), replace the <comma-space> sequence with <comma>, using a regex in the replace function.

When it bothers you that <comma-space> appears in the Log window, you can always write it to file.

@gabriel’s solution doesn’t give you the commas, so if you want the comma, you might amend his suggestion to

a = newArray("a", "b", "2", "3");
o=a[0];
for (i=1;i<lengthOf(a);i++){
	o=o+","+a[i];
}
print(o);