aeltech
asked on
String to Integer
How to convert a string variable to integer variable without using Integer.parseInt() fuction
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That is somebody's homework done.
> Aks him how many of his comments I deleted
Not that many that I can recall :) But some yes.
Not that many that I can recall :) But some yes.
He he he he.... there is a reason why objects did not post full-code. You think him or I couldn't have written it ;-) ?
Hi aeltech,
See link posted by mayankeagle:
value=0;
for each digit : value=value*10+(digit-'0') ;
And if you have signed values, check if first character is '+' or '-' or digit, if '-' then return -value
See link posted by mayankeagle:
value=0;
for each digit : value=value*10+(digit-'0')
And if you have signed values, check if first character is '+' or '-' or digit, if '-' then return -value