RosettaCodeData/Task/Repeat-a-string/Delphi/repeat-a-string-3.delphi

8 lines
144 B
Plaintext

function RepeatStr(const s: string; i: Cardinal): string;
begin
if i = 0 then
result := ''
else
result := s + RepeatStr(s, i-1)
end;