def text.find

ezsys@0.1.0.0 · src/str.bend:207

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

207# the index, in code points, of the first place the needle starts
208def text.find(txt: String, +needle: String) -> Maybe<&2, U32>:
209  match txt:
210    case SNil{}:
211      text.find.end(needle)
212    case SCon{+h, +t}:
213      text.find.at(String.starts_with(SCon{h, t}, needle),
214        _u => text.find(t, needle))

Uses (6)

Used by (1)