Find value at index i and length m .
value = 0 NEW_LINE for j in range ( m ) : NEW_LINE INDENT c = ( ord ( Str [ i + j ] ) - ord ( '0' ) ) NEW_LINE if ( c < 0 or c > 9 ) : NEW_LINE INDENT return - 1 NEW_LINE DEDENT value = value * 10 + c NEW_LINE DEDENT return value NEW_LINE