Decoding string

Discussion in 'Javascript' started by Sonnich, Oct 11, 2006.

  1. Sonnich

    Sonnich Guest

    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
     
    Sonnich, Oct 11, 2006
    #1
    1. Advertising

  2. Sonnich

    zman Guest

    Sonnich wrote:
    > 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

    ----------------------------------------------------
    http://www.vbuniverse.com/sphones.html
    http://sphones.blogspot.com
     
    zman, Oct 11, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWFyaw==?=

    query string encoding/decoding

    =?Utf-8?B?TWFyaw==?=, Mar 3, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    17,342
    T Conti
    Apr 5, 2004
  2. keith_g
    Replies:
    1
    Views:
    220
    MonkeeSage
    Dec 3, 2007
  3. Oreo Shake
    Replies:
    4
    Views:
    134
    Oreo Shake
    Jan 28, 2010
  4. sumit

    Decoding the string

    sumit, Mar 10, 2012, in forum: Java
    Replies:
    0
    Views:
    254
    sumit
    Mar 10, 2012
  5. sajuptpm
    Replies:
    2
    Views:
    403
    sajuptpm
    Dec 28, 2012
Loading...

Share This Page