Remove lines from a file: Difference between revisions

PascalABC.NET
m (→‎{{header|11l}}: new way of specifying file open mode)
(PascalABC.NET)
 
Line 2,184:
{{out}}
<pre></pre>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
procedure RemoveLines(fname: string; start: integer; count: integer := 1);
begin
WriteAllLines(fname,
ReadAllLines(fname).Where((s,ind) -> ind not in start - 1 .. start + count - 2).ToArray)
end;
 
begin
RemoveLines('a2.pas',3,2);
end.
</syntaxhighlight>
 
=={{header|Perl}}==
246

edits