Str.text.truncate: def of ezsys@0.1.0.0 Import: import ezsys@0.1.0.0/src/str.bend as Str Lines 445-453 of ezsys@0.1.0.0/src/str.bend: https://jend.leeeet.dev/read.txt?path=ezsys@0.1.0.0/src/str.bend&start_line=445&end_line=453 import Base # the first `n` code points of the text, or all of it when it is shorter def text.truncate(txt: String, width: Nat) -> String: match txt width: case SNil{} _: SNil{} case SCon{_h, _t} 0n: SNil{} case SCon{h, t} 1n+k: SCon{h, text.truncate(t, k)} Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String