def num
import cswap-bend-cli@0.1.0.0/clock.bend as Clockimport Base
90# The n digits of `s` at offset `off`, as a number.
91def num(+s: String, off: Nat, +n: Nat) -> Maybe<&2, U32>:
92 +slice = String.take(String.drop(s, off), n)
93 num.pick(all_digits(slice) && Nat.is_eq(String.length(slice), n), slice)