6

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

isNumeric Method Definition

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
dspano
  • 1,540
  • 13
  • 25

2 Answers2

10

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:

StringUtils.isNumeric("\u0967\u0968\u0969")  = true

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.

dspano
  • 1,540
  • 13
  • 25
  • 3
    And for what it's worth, my browser displays presumably-correct glyphs for those digits, rather than subbing in question marks. – John Bollinger Nov 03 '16 at 15:10
3

Looking at the code, the example is

StringUtils.isNumeric("\u0967\u0968\u0969")  = true

\u0967 is , which is "Devanagari Digit One"

\u0967 is , which is "Devanagari Digit Two"

So they are digits!

Jean Logeart
  • 52,687
  • 11
  • 83
  • 118