I can't seem to find an integral type that this will work on:
string foo = "9999999999999999999999999999999999999999999999999999999";
long value;
if(long.TryParse(foo, out value))
{
// do something
}
In .NET 4 you can use System.Numerics.BigInteger which has a TryParse method.
See: http://msdn.microsoft.com/en-us/library/system.numerics.biginteger.aspx
Yes, .NET 4.0 introduces BigInteger which is arbitrarily large and supports TryParse, of course.
http://msdn.microsoft.com/en-us/library/system.numerics.biginteger.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With