  | |  | Re: Format an array | Re: Format an array 2004-03-08 - By Simon Lord
Back Thanks guys. I've only recently started poking with arrays so formatting them is not as obvious to me.
This helps alot, thanks!
On Mar 8, 2004, at 10:11 AM, info@(protected) wrote:
> why don't you just make it like this: > > newString = oldString.split("|").join("\n") > the oldString may be a string containing: > tony|martha|sam|dave > and new String will be like this: > tony\nmartha\nsam\ndave > if you now do: > textField.text = newString, the textfield will look like you wanted > > Simon Lord wrote: >> 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) > > > __ ____ ____ ____ ____ _____ > ..invision.freelance.studios > .......info@(protected) > ........www.invision-team.de > > =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- > 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:106317 > =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- > To unsubscribe send a blank e-mail to: Normal Mode: > flashcoders-unsubscribe@(protected) > Digest Mode: flashcoders-digest-unsubscrive@(protected) > > 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:106323 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- 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.
|
|
 |