RosettaCodeData/Task/Strip-comments-from-a-string/Zkl/strip-comments-from-a-string-1.zkl
2023-07-01 13:44:08 -04:00

8 lines
301 B
Text

fcn strip(text,c){ // if c in text, remove it and following text
if (Void!=(n:=text.find(c))) text=text[0,n];
text.strip() // remove leading and trailing white space
}
fcn stripper(text,a,b,c,etc){ // strip a,b,c,etc from text
foreach c in (vm.arglist[1,*]){ text=strip(text,c) }
text
}