Hi everybody,

I'm starting to work with C#, almost every doubt I've had, I've found it in forums or tutorials in Internet, but there is one that I don't. How can I check if a string value is a number?

I have a function that returns a string and I need to know if this value is a number or not. How can I do this? :rolleyes: The number could be from 0 to 100.

Thanks a lot!!!

Recommended Answers

All 4 Replies

Right!!
It works perfect (at least for me)... :)

Thanks tayspen!!!

See you ... :lol:

int.TryParse(string s, out bool b) is another great function that returns a boolean value to check if string is numeric or not.

commented: 4 years too late. -1

Please do not resurrect old / solved threads. If you have any questions please ask. .... You are welcome to start your own threads.

Thread Closed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.