shithub: mc

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