Solved

How to convert a string to a unsigned long number in C#?

Posted on 2011-03-24
6
429 Views
Last Modified: 2013-12-17
Want to convert a string to a big number. For example, want to achieve
ToULong("1234567890");
 I got the error:
"error CS0103: The name 'ToULong' does not exist in the current context"
0
Comment
Question by:jl66
6 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 170 total points
ID: 35204925
           ulong ul = Convert.ToUInt64("1234567890");
0
 
LVL 19

Assisted Solution

by:Rikin Shah
Rikin Shah earned 30 total points
ID: 35204965
Alternative to ToULong is ToUInt64. Try it.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35204973
Isn't that what I said?
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 150 total points
ID: 35205011
Alternative, albeit it only semantic since they both do the same thing:
ulong ul = ulong.Parse("1234567890");

Open in new window

0
 
LVL 8

Assisted Solution

by:cubaman_24
cubaman_24 earned 150 total points
ID: 35214157
And with tryparse..

Best regards.
ulong number;
if(ulong.TryParse("33535355353", out number){
// Do stuf
}

Open in new window

0
 

Author Closing Comment

by:jl66
ID: 35220815
Really appreciated everyone's tips.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now