summaryrefslogtreecommitdiff
path: root/lib/std/hasprefix.myr
blob: a652cd6207a3963dcad03f1452fe951216c86dd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use "cmp"

pkg std =
	const hasprefix	: (s : byte[:], pre : byte[:] -> bool)
;;

const hasprefix = {s, pre
       match strncmp(s, pre, pre.len)
       | `Equal:       -> true
       | _:            -> false
       ;;
}