shithub: mc

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