Validate if a given string is numeric.
Have you met this question in a real interview?
Yes
Example
"0"
=> true
" 0.1 "
=> true
"abc"
=> false
"1 a"
=> false
"2e10"
=> true
LeetCode上的原题,请参见我之前的博客Valid Number。
时间: 2024-10-17 17:52:20
Validate if a given string is numeric.
Have you met this question in a real interview?
Yes
Example
"0"
=> true
" 0.1 "
=> true
"abc"
=> false
"1 a"
=> false
"2e10"
=> true
LeetCode上的原题,请参见我之前的博客Valid Number。