Answers for "js regex to check if string contains a number"

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 "js regex to check if string contains a number"

Code answers related to "Javascript"

Browse Popular Code Answers by Language