Str.text.replace.go: def of ezsys@0.1.0.0 Import: import ezsys@0.1.0.0/src/str.bend as Str Lines 101-117 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=101&end_line=117 import Base # the scan for a nonempty `old`; `skip` characters of a found `old` are # still to pass over def text.replace.go( txt: String, skip: Nat, +old: String, +new: String ) -> String: match txt skip: case SNil{} _: SNil{} case SCon{_h, t} 1n+k: text.replace.go(t, k, old, new) case SCon{+h, +t} 0n: text.replace.at(String.starts_with(SCon{h, t}, old), h, new, text.after(old), k => text.replace.go(t, k, old, new)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.starts_with https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.after https://jend.leeeet.dev/definition.txt?path=ezsys@0.1.0.0/src/str.bend&name=text.replace.at