Tapojjwal Mandal

Hi...I want to know how to store element in 2 D array Suppose I have a String

a.txt;1.0.0.0:b.dll;2.0.0.0:C.doc;4.1.0.2: Like this. The Delemeter used here is : and ; . Now I want to store it in a 2d array where the array structure will be like -

a.txt 1.0.0.0

b.dll 2.0.0.0

C.doc 4.1.0.2

Like that....I need help.




Re: Windows Forms General How to load element in 2-D array?

Muthu Krishnan. R

Code Snippet

Public Function SplitString(ByVal s As String) As String(,)

Dim arr1 As String() = s.Split(":"c)

Dim aOut As String(,) = New String(arr1.Length - 1, 1) {}

For i As Integer = 0 To arr1.Length - 1

Dim arr2 As String() = arr1(i).Split(";")

aOut(i, 0) = arr2(0)

aOut(i, 1) = arr2(1)

Next

Return aOut

End Function