All pastes #940719 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-03-13 06:27 UTC
rendered paste body
        Dim str As String 'Define a string varible
        Dim sum As Integer 'Define integer variable

        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
        Next