Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript find a digit in str

var regex = /d+/g;
var string = "Any string you want!";
var matches = string.match(regex);  // creates array from matches

if (matches){
  // There is a digit in the string.
} else {
  // No Digits found in the string.
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #find #digit #str
ADD COMMENT
Topic
Name
7+5 =