Click here to Skip to main content
15,882,464 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a string "str1" and the value is given below
string str1= "513442148741311";

How to convert the string value to integer value?

please someone Help me....
Updated 6-Jun-13 21:49pm

You can use BigInteger.TryParse Method[^]. See this:
BigInteger number1;
BigInteger.TryParse("12347534159895123", out number1);
//Now converted number is stored in number1 variable

Share this answer
Share this answer[^][^]

Make sure that the string contains the number within the range of an integer
Share this answer
string str1= "513442148741311";
int64 str2=convert.ToInt64(str1);
now the string value is converted to int...
Share this answer
string str1= "513442148741311";
Share this answer
string str1= "513442148741311"; // str1 is string value
int str2=convert.toint32(str1); or
int str2=convert.toint64(str1); // for bigint
str1 string value is converted into integer value str2.
thank u.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900