The best resource for .NET Developers. This blog guides about .NET (C#.NET, ASP.NET, ASP.NET MVC, SQL Server, ADO.NET), AngularJS, JSON, HTML, JavaScript, jQuery, CSS, Bootstrap, DotNetNuke, and .NET interview questions. This blog teaches everything about the .NET. Here you can find bunch of tutorials, Tips and tricks, code samples and examples.
Pages
▼
Thursday, 17 October 2013
How to check string is number or not in C#
Method
publicstatic Boolean IsNumeric(string stringToTest)
{
int result;
returnint.TryParse(stringToTest, out result);
}
Usage
bool result = IsNumeric("value"); //result is falsebool result = IsNumeric("1234"); //result is true
No comments:
Post a Comment