您可以使用 TStringList 将 Clipboard.AsText 转换为单独行的列表。然后使用字符串索引从字符串列表中获取单独的行。例如:
procedure TForm21.Button1Click(Sender: TObject);
var
sl: TStringList;
begin
sl := TStringList.Create;
try
sl.Text := clipboard.AsText;
Edit1.Text := sl[2];
finally
sl.Free;
end;
end;
Run Code Online (Sandbox Code Playgroud)