本文介绍了当输入为“???”时,StringUtils isNumeric返回true,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读commons.apache.org

解决方案

通过查看 isNumeric方法的源代码。
在源代码中,该行显示为:

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

其中u0967,u0968,u0969是Devangari数字分别为一,二和三。
这可能是浏览器问题导致无法在API中正确呈现字符。


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:

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.

这篇关于当输入为“???”时,StringUtils isNumeric返回true,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 17:43