def starts_with

bend-kit-bytes@0.3.3.0 · bytes.bend:483

import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import Base

483# Does b begin with prefix (a byte string)?
484def starts_with(b: Bytes, +prefix: String) -> Bytes & Bool:
485  Bytes{+len, buf} = b
486  +m = count(prefix, 0)
487  at.if(U32.is_le(m, len), len, buf, prefix, 0)

Uses (7)

Used by (1)