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

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,851 questions

51,772 answers

573 users

How to use Array.SetValue() method to set a value to element at specified position in 1D, 2D and 3D Array in VB.NET

3 Answers

0 votes
Module Module1

    Sub Main()

        Dim arr(5) As String

        arr.SetValue("two", 2)
        Console.WriteLine("arr(2): {0}", arr.GetValue(2))

    End Sub

End Module

' run:
' 
' arr(2): two

 



answered Apr 30, 2016 by avibootz
0 votes
Module Module1

    Sub Main()

        Dim arr2D(5, 5) As String

        arr2D.SetValue("two-three", 2, 3)
        Console.WriteLine("arr2D(2,3): {0}", arr2D.GetValue(2, 3))

    End Sub

End Module

' run:
' 
' arr2D(2,3): two-three

 



answered Apr 30, 2016 by avibootz
0 votes
Module Module1

    Sub Main()

        Dim arr3D(6, 5, 4) As String

        arr3D.SetValue("one-two-three", 1, 2, 3)
        Console.WriteLine("arr3D(1,2,3): {0}", arr3D.GetValue(1, 2, 3))

    End Sub

End Module

' run:
' 
' arr3D(1,2,3): one-two-three

 



answered Apr 30, 2016 by avibootz
...