def trim.back

ezx@1.11.0.0 · src/pkg/pkg.bend:100

import ezx@1.11.0.0/src/pkg/pkg.bend as Pkg
import Base

100# a line with its trailing blanks dropped, read from the front, so that the
101# trim of a line is a walk over it rather than over its reverse
102def trim.back(line: String) -> String:
103  match line:
104    case SNil{}:
105      SNil{}
106    case SCon{+h, t}:
107      +rest = trim.back(t)
108      trim.back.at(Bool.and(blank(h), String.is_empty(rest)), h, rest)

Uses (5)

Used by (1)