Logo

Programming-Idioms

History of Idiom 137 > diff from v16 to v17

Edit summary for version 17 by Algorhythmus:
New Haskell implementation by user [Algorhythmus]

Version 16

2016-11-13, 14:31:01

Version 17

2017-09-12, 15:06:21

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.

Imports
import Data.Char
Code
b = all isDigit s