Skip to Content
0
Former Member
Nov 24, 2006 at 04:19 AM

Looping through a string and check for Number

7924 Views

Hello,

I want to check whether each of the character of a string is numeric. If all numeric then assign each of the numeric character to a variable.

e.g.

string = '123456789'

loop through the string
  if nth character of the string is numeric
    n1 = nth character
  elseif any one of the character is not number then
    error message
  end
end loop

Please help me out.

Kind regards.