Answers for "how to check if string contains digits from 1 to 8 in javascript"

1

check if a string contains digits js

function hasNumber(myString) {
  return /\d/.test(myString);
}
Posted by: Guest on July-22-2020
1

js string have number js

var hasNumber = /\d/;   
      hasNumber.test("ABC33SDF");  //true
      hasNumber.test("ABCSDF");  //false
Posted by: Guest on December-10-2020

Code answers related to "how to check if string contains digits from 1 to 8 in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language