static bool IsOnlyDecimalDigits(string text) { // if text is null, return false. // Otherwise return true if ALL the characters are decimal digits, // or false is ANY ONE character isn't. return(text.IfNotNull(s => !s.Any(c => !JSScanner.IsDigit(c)))); }
private static bool IsOnlyDecimalDigits(string text) { // if text is null, return false. // Otherwise return true if ALL the characters are decimal digits, // or false is ANY ONE character isn't. //return text.IfNotNull(s => !s.Any(c => !JSScanner.IsDigit(c))); return(text.IfNotNull(s => { foreach (char c in s) { if (!JSScanner.IsDigit(c)) { return false; } } return true; })); }