shithub: mc

ref: 804ca7d4abe311fb94e02c8e1cd56aad8865a959
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
}