Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,038 questions

40,897 answers

573 users

How to use GetValue() method to get the value at the specified position in 1D, 2D and 3D Array in VB.NET

Learn & Practice SQL


133 views
asked Apr 29, 2016 by avibootz
edited Apr 29, 2016 by avibootz

3 Answers

0 votes
Module Module1

    Sub Main()

        Dim arr As String() = {"aaa", "bbb", "ccc", "ddd", "eee"}

        Console.WriteLine("arr(3): {0}", arr.GetValue(3))

    End Sub

End Module

' run:
' 
' arr(3): ddd

 





answered Apr 29, 2016 by avibootz
0 votes
Module Module1

    Sub Main()

        Dim arr As String(,) = {{"aaa", "bbb", "ccc", "ddd"},
                                {"eee", "fff", "ggg", "hhh"}}

        Console.WriteLine("arr(0, 2): {0}", arr.GetValue(0, 2))
        Console.WriteLine("arr(1, 3): {0}", arr.GetValue(1, 3))

    End Sub

End Module

' run:
' 
' arr(0, 2): ccc
' arr(1, 3) : hhh

 





answered Apr 29, 2016 by avibootz
0 votes
Module Module1

    Sub Main()

        Dim arr As String(,,) = {{{"aaa", "bbb", "ccc", "ddd"}, {"eee", "fff", "ggg", "hhh"}, {"eee", "fff", "ggg", "hhh"}},
                                 {{"iii", "jjj", "kkk", "lll"}, {"mmm", "nnn", "ooo", "ppp"}, {"qqq", "rrr", "sss", "ttt"}}}

        Console.WriteLine("arr(0, 2, 1): {0}", arr.GetValue(0, 2, 1))
        Console.WriteLine("arr(1, 2, 3): {0}", arr.GetValue(1, 2, 3))

    End Sub

End Module

' run:
' 
' arr(0, 2, 1): fff
' arr(1, 2, 3): ttt
' 

 





answered Apr 29, 2016 by avibootz
edited Apr 29, 2016 by avibootz
...