Method
public static Boolean IsNumeric(string stringToTest) { int result; return int.TryParse(stringToTest, out result); }
Usage
bool result = IsNumeric("value"); //result is false bool result = IsNumeric("1234"); //result is true
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.
public static Boolean IsNumeric(string stringToTest) { int result; return int.TryParse(stringToTest, out result); }
Usage
bool result = IsNumeric("value"); //result is false bool result = IsNumeric("1234"); //result is true
No comments:
Post a Comment