Jump to content
zep

Conjunto de Arrays

Recommended Posts

zep

Tenho vários arrays:

Dim a1 As New List(Of String) From = {"abcd","efg","hi","j"}

Dim a2 As New List(Of String) From = {"abc","ef","h"}

Dim a3 As New List(Of String) From = {"ab","e"}

Dim a4 As New List(Of String) From = {"abcdefghij"}

Como posso criar um array, em que é o conjunto dos arrays em cima mencionado?

Será?

Dim total as new arraylist = {a1+a2+a3+a4}

Edited by zep

Share this post


Link to post
Share on other sites
vikcch

Boas,

Abriste o topico da secção errada.

Não criaste arrays, criaste lists, se queres mesmo arrays procura por Jagged Arrays

Com lists podes fazer isto:

	    Dim a1 As New List(Of String) From {"abcd", "efg", "hi", "j"}
    Dim a2 As New List(Of String) From {"abc", "ef", "h"}
    Dim a3 As New List(Of String) From {"ab", "e"}
    Dim a4 As New List(Of String) From {"abcdefghij"}

    Dim lists As New List(Of List(Of String))
    lists.Add(a1)
    lists.Add(a2)
    lists.Add(a3)
    lists.Add(a4)

    MessageBox.Show(lists.Item(1)(0))

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.