Search
 
SCRIPT & CODE EXAMPLE
 

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 ,
Comment

PREVIOUS NEXT
Code Example
Javascript :: get position of element in react 
Javascript :: javascript 2 return values 
Javascript :: javascript vector 
Javascript :: filter multidimensional array javascript 
Javascript :: javascript switch assignment 
Javascript :: how can i convert object to an array javascript 
Javascript :: vuetify autocomplete get input value 
Javascript :: Ways to iterate array in js 
Javascript :: regex to check 8 < length < 16, one uppercase, one lowercase and must have at least one number and one special character 
Javascript :: upload excel file using jquery ajax 
Javascript :: node js check if called from module 
Javascript :: sequelize findorcreate 
Javascript :: create directory when writing to file in nodejs 
Javascript :: selectize.js setvalue 
Javascript :: how to iterate array in javascript 
Javascript :: primitive and non primitive data types in javascript 
Javascript :: cookie options 
Javascript :: js get words first letter 
Javascript :: express minify html 
Javascript :: convert a string to an array javascript 
Javascript :: short string javascript 
Javascript :: http get response body node js 
Javascript :: react-stripe-checkout 
Javascript :: how to check whether a string contains a substring in javascript 
Javascript :: i want to redirect to main page from iframe javascript 
Javascript :: Data Down Action Up React 
Javascript :: useref() in react 
Javascript :: how to clear an input in testing library 
Javascript :: xpath nodejs 
Javascript :: get n random items from array javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =