Return a int of the string - Node.js String

Node.js examples for String:Parse

Description

Return a int of the string

Demo Code


/**/*from  w ww .j  a  va  2 s  .  co  m*/
 * Return a int of the string
 * @version 1.0.0
 * @date June 30, 2010
 * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}
 * @author Benjamin "balupton" Lupton {@link http://www.balupton.com}
 * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}
 * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}
 */
String.prototype.toInt = String.prototype.toInt || function(){
  // Convert to a Integer
  return parseInt(this,10);
};

Related Tutorials