Answers for "how to get only the numbers from a string"

0

get only numbers from string

/*get only numbers from string*/

str.replace('Rs. ', '').replace(/,/g, '');
or

str.replace(/Rs. |,/g, '');
/,/g is a regular expression. g means global
/Rs. |,/g is a single regular expression that matches every occurence of Rs. or ,
Posted by: Guest on August-09-2021
0

get only numbers from string

/*get only numbers from string*/

str.replace('Rs. ', '').replace(/,/g, '');
or

str.replace(/Rs. |,/g, '');
/,/g is a regular expression. g means global
/Rs. |,/g is a single regular expression that matches every occurence of Rs. or ,
Posted by: Guest on August-09-2021
0

get numbers from a string

parseFloat("123")
Posted by: Guest on March-08-2021
0

get numbers from a string

parseFloat("123")
Posted by: Guest on March-08-2021
0

get numbers from a string

Float.parseFloat("123")
Posted by: Guest on March-08-2021
0

get numbers from a string

Float.parseFloat("123")
Posted by: Guest on March-08-2021

Code answers related to "how to get only the numbers from a string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language