How to convert string array to integer array in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
		Dim s_array = {"123", "456", "789"}
			
		Dim i_array = Array.ConvertAll(s_array, Function(str) Int32.Parse(str))

         For Each item In i_array
            Console.WriteLine(item)
        Next
    End Sub
End Class

	
		
		

' run:
'
' 123
' 456
' 789
'

 



answered Dec 7, 2021 by avibootz

Related questions

...