Decoding string

S

Sonnich

Hi all!

Simple question, but I haven't used JS for a long time.

I get a string, like "1,3" and need to read out the numbers 1 and 3. I
can change the separator if needed, but all I want to is to send to
numbers in a string, then decode them

TIA
Sonnich
 
Z

zman

Sonnich said:
Hi all!

Simple question, but I haven't used JS for a long time.

I get a string, like "1,3" and need to read out the numbers 1 and 3. I
can change the separator if needed, but all I want to is to send to
numbers in a string, then decode them

TIA
Sonnich

Try this
var str="1,2,3,4";
var str_array=str.split(",");

Array str_array contains the list of all the values.

zafar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top