If I have
Character.isDigit('53')
I get error
but if I have:
Character.isDigit('5')
I get a boolean value of TRUE.
Why is that so?
If I have
Character.isDigit('53')
I get error
but if I have:
Character.isDigit('5')
I get a boolean value of TRUE.
Why is that so?
'5'
is a character. '53'
is not a character.
Or, to look at it in terms of strings, "5"
is a string with one character in it ('5'
), and "53"
is a string with two characters in it ('5'
, '3'
).
A character is a single symbol. This means that '5' is a character, but since '53' has two symbols, it is not a character.
'5' and '53' both represent as a string where first contain a character and second contain two character.