Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: vue js encrypt localstorage data 
Javascript :: how to replace div element with another in javascript 
Javascript :: how to pass headers in axios 
Javascript :: framer motion for react 
Javascript :: Prevent Double tap in React native 
Javascript :: js return the highest and lowest number 
Javascript :: anonymous functions javascript 
Javascript :: get yyyy-mm-dd hh:mm from date javascript 
Javascript :: how to set css in hbs in express 
Javascript :: react native dynamically update flatlist data 
Javascript :: js check if image url exists 
Javascript :: axios npm 
Javascript :: typeof date 
Javascript :: angular decorators list 
Javascript :: js fetch status of 500 
Javascript :: ismobile react 
Javascript :: regex char or char 
Javascript :: js format indian price with commas 
Javascript :: css react 
Javascript :: javasciprt set cookie 
Javascript :: jquery validation from data 
Javascript :: js convert obj to array 
Javascript :: how to check if local storage is available 
Javascript :: js jwt decode 
Javascript :: doughnut chartjs with react display percentage 
Javascript :: nginx reverse proxy redirect 
Javascript :: npm simple zip file creator 
Javascript :: Adding A forEach Function To An HTMLCollection JavaScript 
Javascript :: regex look behind 
Javascript :: how to copy a javascript array 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =