Answers for "string contains at least one number"

0

string contains at least one number

// String with some numbers
const str = "Hello12345World!";

// Regular expression
const regex = /\d/;

// Check if string contians numbers
const doesItHaveNumber = regex.test(str);

console.log(doesItHaveNumber); // true
Posted by: Guest on August-16-2021

Code answers related to "string contains at least one number"

Code answers related to "Javascript"

Browse Popular Code Answers by Language