shithub: mc

ref: 4db5274a2f6db10e31e11c503f36c85a98c65fbc
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
       ;;
}