字符串重复

基本类型 / 字符串

uses System.SysUtils, System.StrUtils;

var
  Str1, Str2: string;
begin
  //single character
  Str1 := StringOfChar('7', 3);
  //Str1 is '777'

  //any substring
  Str2 := DupeString('ab', 3);
  //Str2 is 'ababab'

  WriteLn('str1 is ', Str1);
  WriteLn('str2 is ', Str2);
end.