shithub: mc

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