Jump to content

Conjunto de Arrays


zep
 Share

Recommended Posts

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
Link to comment
Share on other sites

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))
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.