javascript - Check if string contains only digits - Stack Overflow
經安全檢測,此網站為安全網站,請放心前往原始網址!
javascript - Check if string contains only digits - Stack Overflow
I want to check if a string contains only digits. I used this: ... how about var isnum
= /^\d+$/.test(val); ... string.match(/^[0-9]+$/) != null; ... String.