Answer the question
In order to leave comments, you need to log in
How to check if a string contains only numbers?
How to check if the string contains all digits and return false if there are not all digits in the string?
const numberValidator = (val) => {
let Reg = new RegExp("/^\d+$/");
return Reg.test(val);
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question