Strip comments from a string: Difference between revisions
PascalABC.NET
m (→{{header|Wren}}: Changed to Wren S/H) |
(PascalABC.NET) |
||
Line 1,511:
=={{header|Pascal}}==
See [[Strip_comments_from_a_string#Delphi | Delphi]]
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
function RemoveComments(s,delim: string): string
:= Regex.Replace(s, delim + '.+', '');
begin
Writeln(RemoveComments('apples, pears # and bananas','#'));
Writeln(RemoveComments('apples, pears ; and bananas',';'));
end.
</syntaxhighlight>
{{out}}
<pre>
apples, pears
apples, pears
</pre>
=={{header|Perl}}==
|