Add int-string? to check if a string is a number.
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-11-01 15:02:44 +02:00
parent 91dc00ea0d
commit e145382570
2 changed files with 18 additions and 0 deletions
@@ -8,6 +8,12 @@
(if (re-matches #"\d+" str)
true false))
(defn int-string?
"Return true if the string is an signed integer."
[str]
(if (re-matches #"[+-]?\b\d+\b" str)
true false))
(defn parse-unsigned-int
"Return an integer if the argument is an integer."
[str-or-int]