def text.replace

ezsys@0.1.0.0 · src/str.bend:127

import ezsys@0.1.0.0/src/str.bend as Str
import Base

127# every `old` replaced by `new`, left to right, never overlapping; an empty
128# `old` puts `new` before every character and at the end
129def text.replace(txt: String, +old: String, +new: String) -> String:
130  match old:
131    case SNil{}:
132      new ++ text.replace.gaps(txt, new)
133    case SCon{oh, ot}:
134      text.replace.go(txt, 0n, SCon{oh, ot}, new)

Uses (4)

Used by (1)