isNumber extension method for string in C#


/ Published in: C#
Save to your folder(s)

isNumber string extension method for testing strings.


Copy this code and paste it in your HTML
  1. public static class StringExtensions
  2. {
  3. public static bool isNumber(this String str)
  4. {
  5. double temp;
  6. return double.TryParse(str, out temp);
  7. }
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.