14 lines · 196 B · Text
RawDownload
use "hasprefix" pkg std =	const chomp	: (str : byte[:]#, pfx : byte[:] -> bool);; const chomp = {str, pfx	if std.hasprefix(str#, pfx)		str# = str#[pfx.len:]		-> true	else		-> false	;;}