How to create a comma delimited string from an ArrayList in VB.NET

1 Answer

0 votes
Imports System
Imports System.Collections

Public Class Program
    Public Shared Sub Main(ByVal args As String())
        Dim al As ArrayList = New ArrayList()
        
        al.Add("c")
        al.Add("c++")
        al.Add("java")
        al.Add("python")
        al.Add("vb.net")
        
        Dim str As String = String.Join(", ", al.ToArray())
        
        Console.WriteLine(str)
    End Sub
End Class

  
  
' run:
'
' c, c++, java, python, vb.net
'

 



answered Jun 3, 2024 by avibootz

Related questions

1 answer 110 views
1 answer 122 views
1 answer 123 views
1 answer 151 views
1 answer 137 views
1 answer 155 views
1 answer 126 views
...