Most elegant isNumeric() solution for java

前端 未结 7 874
囚心锁ツ
囚心锁ツ 2021-02-13 01:31

I\'m porting a small snippet of PHP code to java right now, and I was relying on the function is_numeric($x) to determine if $x is a number or not. Th

7条回答
  •  鱼传尺愫
    2021-02-13 01:57

    Have you looked into using StringUtils library? There's a isNumeric() function which might be what you're looking for. (Note that "" would be evaluated to true)

提交回复
热议问题