Solved

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

Posted on 2011-03-24
6
426 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Library to convert HTML to PDF. 8 44
Exception in Log4Net 1 18
cs.Designer Issue 2 14
Handle null when using linq in this line 1 20
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

12 Experts available now in Live!

Get 1:1 Help Now