15,882,464 members
1.00/5 (1 vote)
See more:
I have a string "str1" and the value is given below
C#
string str1= "513442148741311";

How to convert the string value to integer value?

please someone Help me....
Thank-you.....
Posted
Updated 6-Jun-13 21:49pm
v2

## Solution 5

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

--Amit

## Solution 2

http://msdn.microsoft.com/en-us/library/vstudio/bb397679.aspx[^]

http://msdn.microsoft.com/en-us/library/5kzh1b5w(v=vs.80).aspx[^]

Make sure that the string contains the number within the range of an integer

## Solution 3

string str1= "513442148741311";
int64 str2=convert.ToInt64(str1);
now the string value is converted to int...
thankuuu...

## Solution 4

string str1= "513442148741311";
Convert.toInt64(str1)

## Solution 6

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.

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

Top Experts
Last 24hrsThis month
 Graeme_Grant 40 OriginalGriff 20 Ebandi 10 Maciej Los 10 Wonde Tadesse 5
 Pete O'Hanlon 1,940 OriginalGriff 1,425 Graeme_Grant 935 Richard Deeming 853 Dave Kreskowiak 694

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