def before.go
import bend-lint-api@0.2.0.0/shared/strings.bend as Stringsimport Base
57def before.go(s: String, +sep: Char, acc: String, at: Bool) -> String:
58 match s at:
59 case SNil{} _:
60 ""
61 case _ True{}:
62 String.reverse(acc)
63 case SCon{c, +rest} False{}:
64 before.go(rest, sep, SCon{c, acc}, starts_with(rest, sep))