Logo

Programming-Idioms

History of Idiom 137 > diff from v25 to v26

Edit summary for version 26 by Cellery72:
New Csharp implementation by user [Cellery72]

Version 25

2018-12-30, 11:46:23

Version 26

2019-09-26, 13:42:29

Idiom #137 Check if string contains only digits

Set boolean b to true if string s contains only characters in range '0'..'9', false otherwise.

Idiom #137 Check if string contains only digits

Set boolean b to true if string s contains only characters in range '0'..'9', false otherwise.

Code
bool b = s.All(char.IsDigit);