15

I am using the StringOfChar function to create a string of chars like this

S := StringOfChar('b', 5); //s is set to 'bbbbb'

Is there any RTL function that does the same (like StringofString('abc',3) must return 'abcabcabc' ), but accepts a string as parameter instead of char? I can write a function like that but I'm looking for an existing RTL function.

Johan
  • 74,508
  • 24
  • 191
  • 319
Salvador
  • 16,132
  • 33
  • 143
  • 245

1 Answers1

22

the function which you are looking for is StrUtils.DupeString

s:=DupeString('abc',3)

will return

'abcabcabc'
RRUZ
  • 134,889
  • 20
  • 356
  • 483