Reputation: 112
My question is how to make the three steps I use into one step; how do I combine these to just one?
Thank you!
var string = "1.4 Whatever";
var a = string.replace(/[0-9]/g,'');
var b = a.replace(/[\.]/g, '');
var c = b.replace(/ /g, '');
console.log(c);
Upvotes: 0
Views: 30
Reputation: 3772
Just like this
var string = "1.4 Whatever";
var a = string.replace(/[0-9\. ]/g,'');
console.log(a);
Upvotes: 1