Answers for "get only numbers from 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

Code answers related to "get only numbers from string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language