3 ms·
> We check whether some value exceeds 9, If I'm seeing the misunderstanding here, the article with that statement is not talking about string length. They're t
by joe_guy 3y ago
> We check whether some value exceeds 9,
If I'm seeing the misunderstanding here, the article with that statement is not talking about string length. They're talking about if non numerical input was given, ie, "a" would "exceed 9"
- Karellen 3y agoRight, but an "a" would be past the end of the digits, and the code assumes you know the end of the digits. It would make more sense if it was talking about the string length. Then you might find a non-digit before the end. But it specifically says you know where the end of the digits is, not the end of the string. Edit: Or, I'm trying to figure out what code might exist that found the end of the digits, but not always? The article says "assume you already know this", but computers aren't magic. There's code that figures out where the end of the digits is. So how does that code work, where it finds the end of the digits, but sometimes counts non-digits as digits?