def cut.end
import ezx@1.11.0.0/src/ez/target.bend as Targetimport Base
235# `s` with a suffix of `n` chars taken off when it ends in that suffix.
236# `Bool.pick` builds both arms, which is the same trade `pkg/path.unbend` makes.
237def cut.end(+text: String, +suf: String, len: Nat) -> String:
238 Bool.pick(String, String.ends_with(text, suf),
239 String.take(text, Nat.sub(String.length(text), len)), text)