def free_of

snap@1.4.0.0 · src/argv.bend:18

import snap@1.4.0.0/src/argv.bend as Argv
import Base

18# whether a string holds no copy of a char
19def free_of(text: String, +sep: Char) -> Bool:
20  match text:
21    case SNil{}:
22      True{}
23    case SCon{ch, tail}:
24      rest = free_of(tail, sep)
25      Bool.and(Bool.not(Char.is_eq(ch, sep)), rest)

Uses (6)

Used by (1)