Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to find number in string js

// To find a number in a string
const str = "sdfh0d5f6"
const result = str.match(/d+/g)

console.log(result)
// ['0', '5', '6']
 
PREVIOUS NEXT
Tagged: #find #number #string #js
ADD COMMENT
Topic
Name
8+9 =