Target.cut.end: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/ez/target.bend as Target Lines 235-239 of ezx@1.11.0.0/src/ez/target.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/ez/target.bend&start_line=235&end_line=239 import Base # `s` with a suffix of `n` chars taken off when it ends in that suffix. # `Bool.pick` builds both arms, which is the same trade `pkg/path.unbend` makes. def cut.end(+text: String, +suf: String, len: Nat) -> String: Bool.pick(String, String.ends_with(text, suf), String.take(text, Nat.sub(String.length(text), len)), text) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.ends_with https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.take