convert a string to integer





4
Date Submitted Thu. Aug. 10th, 2006 2:03 AM
Revision 1 of 1
Syntax Master sundaramkumar
Tags JavaScript
Comments 1 comments
convert a string to intege


//convert a  string to integer
s = "12";
i = parseInt(s, 10);

//or you can do like this

i = eval(s)

//or you can do like this

 i = s − 0;

 

Comments

Comments read the last line as
Thu. Aug. 10th, 2006 2:18 AM    Syntax Master sundaramkumar

Voting