Dim str As String 'Define a string varible Dim sum As Integer 'Define integer variable Dim numArray As New ArrayList 'Define a dynamic array, members can be accessed like numArray(0), numArray(1), etc str = "32456" 'Set the string value For i = 0 To (str.Length - 1) 'i is your increment counter, the for loop increases i by one each loop sum = sum + Integer.Parse(str.Chars(i)) 'Extract the character at position i and convert it to an integer data type and add it to the sum numArray.Add(Integer.Parse(str.Chars(i))) 'Store the integer in dynamic array Next