CSharp examples for System:Char
Validates the char is 0-9
using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from w w w . ja v a2s . c o m*/ public class Main{ /// <summary> /// Validates the char is 0-9 /// </summary> public static bool IsUnsigned(this char c) { return char.IsDigit(c); } #region String and Char validation extensions /// <summary> /// Validates all chars are 0-9 /// </summary> public static bool IsUnsigned(this string str) { if (string.IsNullOrWhiteSpace(str)) { return false; } return str.All(IsUnsigned); } }