How convert delimited string to arraylist and visa versa?

Using VB.NET...

How do you convert a comma delimited string to an arraylist?

How do you convert an arraylist to a comma delimited string?
LVL 9
RobertNZanaAsked:
Who is Participating?
 
vigylantCommented:
Like so:
        'To arraylist
        Dim CSV As String = "a;b;c;d"
        Dim AL As New ArrayList(CSV.Split(";"))
 
        'From arraylist
        Dim NewCSV As String = ""
        For Each S As String In AL
            NewCSV &= S & ";"
        Next
        NewCSV = NewCSV.Substring(0, NewCSV.Length - 1)

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.