How to convert string to int?I know convert.ToInt32 is used.But it fail.Error is input string is not in proper format.
String s1 = “12.00”
How to convert string to int?I know convert.ToInt32 is used.But it fail.Error is input
Share
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.
error is because string is
"12.00"first convert string to double than in int
or
IF you just want integer part of it than
Also check already answered threads on SO : C# Convert String Decimal to Int