Link to home
Start Free TrialLog in
Avatar of aeltech
aeltech

asked on

String to Integer

How to convert a string variable to integer variable without using Integer.parseInt() fuction
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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 ;-) ?
Avatar of Webstorm
Webstorm

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