Logo

Programming-Idioms

History of Idiom 137 > diff from v28 to v29

Edit summary for version 29 by lab419:
New Elixir implementation by user [lab419]

Version 28

2019-09-26, 13:52:20

Version 29

2019-09-26, 13:54:16

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
b =  Regex.match?(~r{\A\d*\z}, s)