shithub: mc

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