shithub: mc

ref: 09a34baac6757c7a4c33e3e3c50054acbb1b70bb
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
}