Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
function parseIntRight(str,radix){
return parseInt(str.split(/\D/).pop(),radix);
}
/*
String.prototype.parseIntRight=function(radix){
return parseInt(this.split(/\D/).pop(),radix);
};
// ["wer12".parseIntRight(),parseIntRight("sas124")]; //-> 12,124
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment