shithub: mc

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