I have a string
“1.0.0.1”;
I want to convert this string to numeric values = 1001;
how do i do this?
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.
The easiest way would be to strip out the periods and parse:
Note – this version will throw an exception if the string is not a number once the periods are stripped out. If you don’t want this behaviour, you can use
int.TryParse