This question already has an answer here:
- Why is '१२३' numeric? 5 answers
I was reading the commons.apache.org isNumeric
method definition and it states:
StringUtils.isNumeric("???") = true;
I am not sure why "???"
is considered to be numeric. My guesses are:
- A
"?"
is considered a unicode digit - It is some kind of regex pattern
I was able to find the answer to this question by looking at the StringUtils source code for the isNumeric method. In the source code that line appears as:
Where u0967, u0968, u0969 are Devangari Digits one, two, and three respectively. This may be a browser issue causing the characters to not be rendered correctly in the API.
Looking at the code, the example is
\u0967
is१
, which is "Devanagari Digit One"\u0967
is२
, which is "Devanagari Digit Two"So they are digits!