shithub: mc

ref: 303798469e8afe0e514c667f3c8c7ae2c65e58c5
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
}