Results 1 to 7 of 7

Thread: Javascript equiv to Join, Split

  1. #1

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    Javascript equiv to Join, Split

    I have a comma delimited string. I want to put in array, and then back to comma delimited string later. Can someone give me an example please?

    thx in advance.

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    the String object has a split([separator][, limit])
    method.
    limit is a limit on the number of splits to be found.

  3. #3
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    I'm pretty sure join() exists too, but I'm not sure on the parameters.
    Have I helped you? Please Rate my posts.

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    her it is:
    join([deliminator])

    where deliminator default is a comma. so

    myString = myArray.join()

    should get the whole array back into a string seperated by a comma.
    Have I helped you? Please Rate my posts.

  5. #5

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258
    Thanks guys. I was expecting to have to write some loop with lots of parsing, but I guess that java guys did good

    thx again.

  6. #6
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    heh, java != JavaScript, there's already a big thread going on about this.

    JavaScript guys did good.
    Have I helped you? Please Rate my posts.

  7. #7

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258
    Yeah, I think we are all aware of that. I don't really know to many of the differences though. That's what forums are for

    thx for helping.
    'sneed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width