i have string like those / 5 or / 91 or / 358. I need to get the integers after last space from those strings. Here is how I do it know but it only can get one number. How to make it?
f_quantity = f_quantity.substr(f_quantity.length - 1);
Is the string always of the format ' / NUM'? If so, use this to get the string of the number:
f_quantity = f_quantity.substr(3, f_quantity.length);
And then this to turn it into an actual number:
f_quantity = parseInt(f_quantity);
Or as a one-liner:
f_quantity = parseInt(f_quantity.substr(3, f_quantity.length));
parseIntorparseFloat/too :P