Remove arry entry from multidimensional array

Discussion in 'Javascript' started by David, Nov 12, 2006.

  1. David

    David Guest

    Hi All,

    Is there a way to remove an array entry completely from a multidimensional
    array? I have successfully "emptied" the selected array but it leaves behind
    an empty array entry.

    For example:
    mainArray = [[arry0],[arry1],[arry2],[arry3],[arry4]]

    Example of the nested arrays:
    arry0 = ["text0","text1","text2","text3","text4","text5"]
    arry1 = ["text0","text1","text2","text3"]
    etc..

    The nested arrays are arrays of strings and are of different lengths. How
    does one remove one of the nested arrays completely from the mainArry?

    David J.
     
    David, Nov 12, 2006
    #1
    1. Advertising

  2. David

    David Guest

    > Is there a way to remove an array entry completely from a multidimensional
    > array? I have successfully "emptied" the selected array but it leaves
    > behind an empty array entry.
    >
    > For example:
    > mainArray = [[arry0],[arry1],[arry2],[arry3],[arry4]]



    I figured it out.. It is no different than splicing from a one dimensional
    array. Your just splicing out an entire array instead of a single array
    entry.

    mainArray.splice(theSelectedArrayToRemove, 1);

    David J.
     
    David, Nov 12, 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. systolic
    Replies:
    6
    Views:
    648
    rickman
    Oct 24, 2004
  2. Freddy Drogt

    Filter arry

    Freddy Drogt, Jan 29, 2004, in forum: Perl
    Replies:
    0
    Views:
    546
    Freddy Drogt
    Jan 29, 2004
  3. Simon-Pierre  Jarry
    Replies:
    2
    Views:
    2,378
    Henrik
    Aug 10, 2005
  4. AtomicBob
    Replies:
    14
    Views:
    899
    Toby Inkster
    May 2, 2006
  5. Mike Owen

    Allowing entry of a Carriage Return during data entry

    Mike Owen, Jul 27, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    716
    Alessandro Zifiglio
    Jul 27, 2006
Loading...

Share This Page