shithub: mc

ref: 133e0113e998eacbb469db5e773552ed69c85a55
dir: /lib/std/hasprefix.myr/

View raw version
use "cmp"
pkg std =
	const hasprefix	: (s : byte[:], pre : byte[:] -> bool)
;;

const hasprefix = {s, pre
       match strncmp(s, pre, pre.len)
       | `Equal:       -> true
       | _:            -> false
       ;;
}