Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 ,
 
PREVIOUS NEXT
Tagged: #numbers #string
ADD COMMENT
Topic
Name
6+3 =