8 lines
226 B
ObjectPascal
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.
|