RosettaCodeData/Task/Strip-comments-from-a-string/PascalABC.NET/strip-comments-from-a-strin...

8 lines
226 B
ObjectPascal

function RemoveComments(s,delim: string): string
:= Regex.Replace(s, delim + '.+', '');
begin
Writeln(RemoveComments('apples, pears # and bananas','#'));
Writeln(RemoveComments('apples, pears ; and bananas',';'));
end.