shithub: mc

ref: f2e8e641bf8ee06fa5128c522b151a7f4d9d003b
dir: /lib/std/hassuffix.myr/

View raw version
use "traits"
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:]
		-> eq(tail, suff)
	;;
	-> false
}