Javascript String toInt()
String.prototype.toInt = function() { return parseInt(this, 10); };
String.prototype.toInt = function() { return parseInt(this); }
/*//from w ww. j a v a 2 s.c o m * String.toInt.js * * Copyright (c) 2012 Tomasz Jakub Rup <tomasz.rup@gmail.com> * * https://github.com/tomi77/Date.toLocaleFormat/ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ /** * Return a int representation of string. * * @return int */ String.prototype.toInt = function() { return parseInt(this); }
/**//from www. ja va 2s . c om @function */ String.prototype.toInt = function() { return parseInt(this, 10); };