fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 137: Check if string contains only digits
Idiom # 137: Check if string contains only digits
See
programming-idioms.org
:
Code
is_digit(cp codepoint) => "012345689".as_codepoints ∃ digit -> digit = codepoint s := "012345689" b := s.as_codepoints ∀ (x -> is_digit x)
What are effects?
Running Example
ex137 is is_digit(cp codepoint) => "012345689".as_codepoints ∃ digit -> digit = cp s1 := "012345689" b1 := s1.as_codepoints ∀ (x -> is_digit x) say b1 s2 := "a012345689" b2 := s2.as_codepoints ∀ (x -> is_digit x) say b2
What are effects?
last changed: 2024-07-01
next: NYI: Idiom # 138: Create temp file