coding help
#2
charAt equates to an integer (ASCII codes). See here for more information: https://www.cs.cmu.edu/~pattis/15-1XX/co...ascii.html.

Therefore, parseInt() won't throw an error. If you want to test if it's not a number, try this:

Code:
char thisChar = ssn.charAt(i);
if (thisChar < 48 || thisChar > 57) {
    // handle error
}


I post about the latest site updates on the Dev Log. If you have suggestions, feel free to post them here.
@Eternal and I pay for this site out of our own savings. Please consider donating to help keep Jiggmin's Village running.
The Following 1 User Says Thank You to bls1999 For This Useful Post:
  • JEEJAYEM
Reply


Messages In This Thread
coding help - by JEEJAYEM - 28th April 2020, 2:47 PM
RE: coding help - by bls1999 - 28th April 2020, 3:43 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)