Я просто хочу удалить из указанного текстового файла первые N символов, но я застрял. Помогите мне, пожалуйста!
procedure HeadCrop(const AFileName: string; const AHowMuch: Integer);
var
F: TextFile;
begin
AssignFile(F, AFileName);
// what me to do next?
// ...
// if AHowMuch = 3 and file contains"Hello!" after all statements
// it must contain "lo!"
// ...
CloseFile(F);
end;
Я пытался использовать TStringList, но он дополнительно добавляет символ конца строки!
with TStringList.Create do
try
LoadFormFile(AFileName); // before - "Hello!"
// even there are no changes...
SaveToFile(AFileName); // after - "Hello!#13#10"
finally
Free;
end;
Спасибо!