PDA

View Full Version : convert array to string



apple
September 5th, 2003, 05:32 AM
Hello, is anyone know how to convert array to string??

Hope someone can help me out.
Thanks.

Syntax
September 5th, 2003, 06:14 AM
email = new Array("mail1@mail.com","mail2@mail.com","mail3@mail.com");
stringa = email.toString();

kode
September 5th, 2003, 06:25 AM
Did you read my last post in this (http://www.kirupaforum.com/forums/showthread.php?s=&threadid=33457#post303932) thread, apple? :sigh:

apple
September 7th, 2003, 10:24 PM
kode and syntax, thanks for the help. I finally got what i want. I was using the join method.

By the way, as i was doing this, something has come to my mind. What if i checking an numeric answer. For example, the correct answer is 15. But, i type in 0015, 15.0 and these answers are acceptable. So, what should do to absolute it to become 15?

Thanks

kode
September 7th, 2003, 10:54 PM
var ans = parseInt(Inp.text, 10);
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary621.html

apple
September 7th, 2003, 11:38 PM
Thanks, kode. But, when i type in "0015", the answer appeared in the output window was 13 instead of 15. Why??

kode, i will post this as a new thread. Could you go and check that under Fill in the blank in numeric?? Thanks

[m]
September 8th, 2003, 08:36 AM
email = ["mail1@mail.com","mail2@mail.com","mail3@mail.com","0015"];
// lets pick 0015
theNumber = new Number(email[3]);
// et voila!
trace(theNumber)