how to convert string to integer??
for ex:
- “5328764”,to int base 10
- “AB3F3A”, to int base 16
any code will be helpfull
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming arbitrary base (not 16, 10, 8, 2):
In C (C++), use
strtolIn Javascript, use
parseInt.In Python, use
int(string, base).In Java, use
Integer.parseInt(thanks Michael.)In PHP, use
base_convert.In Ruby, use
to_iIn C#, write one yourself.