shithub: mc

ref: 5e0c7cc7675adf25f01f33f0fd4b6243ae37f527
dir: /lib/std/hassuffix.myr/

View raw version
use "sleq"

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

const hassuffix = {s, suff
	var tail

	if suff.len <= s.len
		tail = s[s.len - suff.len:]
		-> sleq(tail, suff)
	;;
	-> false
}