shithub: mc

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