  | |  | Format an array | Format an array 2004-03-08 - By Simon Lord
Back I made a functional little loop that splits an array and sends it out to a text field. The problem is the result is not really what I want. I want the result to put each item on a new line instead of using a comma.
The array contains a list of usernames with the pipe character as the deliminator. I split this out but all it did was remove my pipe and replaced it with a comma. :P
So, what I have is:
tony,martha,sam,dave...
... what I want is:
tony martha same dave
Here is the code I cobbled together:
var userList = this.theText.split("|"); z = 0; var outputArray = new Array(); while (z<userList.length) { outputArray.push(userList[z]); z++; } _root.listnames = outputArray;
Sincerely, Simon
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106314 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |