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 ;;}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
;;
}